C# - how to display taskbar icon for borderless form?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • plevintampabay
    New Member
    • Jan 2008
    • 2

    C# - how to display taskbar icon for borderless form?

    I have a borderless form in C#.
    The form has an icon specified in its properties and I also have the same icon specified for the project in the project properties.
    When I had a border on the form, the icon was displayed in the task bar. But when I set the border to None, the icon no longer displays. The taskbar button only shows the text name of my program.

    How can I get the icon to display in the taskbar for a borderless form?

    Thanks.
  • plevintampabay
    New Member
    • Jan 2008
    • 2

    #2
    Problem solved.

    The problem was my ico file. I only had a 32x32 (true color + alpha) image in the ico file. This worked fine on all OS's (Win2K, XP and Vista) so long as I had a border on the form. But when I went to no border, it did not work for Win2K and Vista.

    I created an ico file with 16x16, 32x32, 48x48, and 256x256, all true color + alpha. Now I have the icon in the taskbar button on all OS's (for the no border form). I could not tell you which of the icon images is being used where, but I don't care. They were simple enough to create and the problem is solved.

    Along with the bit of code obtained from
    http://www.msdner.com/dev-archive/180/2-8-1806474.shtm ,
    I now have a borderless form with a taskbar button that has the icon and menu.

    Paul

    Comment

    • Plater
      Recognized Expert Expert
      • Apr 2007
      • 7872

      #3
      If you really wanted to know which icon was showing, you could change up what is shown in the different sizes. (i.e. make the picture for each size different)

      Comment

      Working...