Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Removing Icon from a Form

Removing Icon from a Form

Scheduled Pinned Locked Moved C#
winformscomtoolsquestion
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Luis Alonso Ramos
    wrote on last edited by
    #1

    I have a form with FormBorderStyle set to Sizable, and no minimize or maximize buttons, and no ShowInTaskbar. It displays the default Windows Forms icon in the title bar, even if I set the Icon property to null in the constructor. Is there a way to have a sizable dialog without that little icon in the caption? How? Thanks! -- LuisR


    Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!

    D 1 Reply Last reply
    0
    • L Luis Alonso Ramos

      I have a form with FormBorderStyle set to Sizable, and no minimize or maximize buttons, and no ShowInTaskbar. It displays the default Windows Forms icon in the title bar, even if I set the Icon property to null in the constructor. Is there a way to have a sizable dialog without that little icon in the caption? How? Thanks! -- LuisR


      Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      The only way to do it is to set the icon to an image that matches the color o the title bar. You can't not have an icon there. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

      L L 2 Replies Last reply
      0
      • D Dave Kreskowiak

        The only way to do it is to set the icon to an image that matches the color o the title bar. You can't not have an icon there. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

        L Offline
        L Offline
        Lars Niedziolka
        wrote on last edited by
        #3

        There are two other ways: 1st way: It's most like the idea of Dave. Use a icon where all pixel are transparent. 2nd way: Set the borderstyle to sizeable Toolwindow. The caption bar is a bit smaller.

        L 1 Reply Last reply
        0
        • D Dave Kreskowiak

          The only way to do it is to set the icon to an image that matches the color o the title bar. You can't not have an icon there. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

          L Offline
          L Offline
          Luis Alonso Ramos
          wrote on last edited by
          #4

          Yes, I had thought about an all-transparent icon, but it still leaves the text a little more to the right than usual. I've seen resizable windows without an icon, but I don't know if they're .NET apps or not. For example the common Open dialog in Visual Studio (that's not .NET, but I remember seeing another window in Visual Studio which I cannot find). -- LuisR


          Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!

          L 1 Reply Last reply
          0
          • L Lars Niedziolka

            There are two other ways: 1st way: It's most like the idea of Dave. Use a icon where all pixel are transparent. 2nd way: Set the borderstyle to sizeable Toolwindow. The caption bar is a bit smaller.

            L Offline
            L Offline
            Luis Alonso Ramos
            wrote on last edited by
            #5

            Lars Niedziolka wrote: Set the borderstyle to sizeable Toolwindow. The caption bar is a bit smaller. Yes, I know, but that's not what I'm looking for... thanks! -- LuisR


            Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!

            1 Reply Last reply
            0
            • L Luis Alonso Ramos

              Yes, I had thought about an all-transparent icon, but it still leaves the text a little more to the right than usual. I've seen resizable windows without an icon, but I don't know if they're .NET apps or not. For example the common Open dialog in Visual Studio (that's not .NET, but I remember seeing another window in Visual Studio which I cannot find). -- LuisR


              Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!

              L Offline
              L Offline
              Lars Niedziolka
              wrote on last edited by
              #6

              Hi Luis, the solution is very simple. Set the property ControlBox of the form to false. -- Niedzi

              L 1 Reply Last reply
              0
              • L Lars Niedziolka

                Hi Luis, the solution is very simple. Set the property ControlBox of the form to false. -- Niedzi

                L Offline
                L Offline
                Luis Alonso Ramos
                wrote on last edited by
                #7

                Thanks, but I tried that too and it also hides the close button on the right of the caption bar. Maybe it's not possible with the framework. Thanks anyway. -- LuisR


                Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups