By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,293 Members | 1,397 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,293 IT Pros & Developers. It's quick & easy.

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

P: 2
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
Share this Question
Share on Google+
2 Replies


P: 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
Jan 7 '08 #2

Plater
Expert 5K+
P: 7,872
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.