469,946 Members | 1,805 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,946 developers. It's quick & easy.

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.
Jan 5 '08 #1
2 4127
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
Jan 7 '08 #2
Plater
7,872 Expert 4TB
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)
Jan 7 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Elad Gutman | last post: by
reply views Thread by Jean Bredeche | last post: by
2 posts views Thread by hohrin | last post: by
5 posts views Thread by michael sorens | last post: by
2 posts views Thread by Paul E Collins | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.