471,337 Members | 790 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes and contribute your articles to a community of 471,337 developers and data experts.

C#: Setting Icons

7,872 Expert 4TB
C# (and possibly VB.NET) in VS2005 can be a bit tricky.
Here's my little rundown:

Add an icon file to your project (new or exisiting, whichever)
Open the icon file is VS and edit as desired.
(Note: On the left hand side is a small preview of the icon, extra sizes can be added to the SAME icon file there as well as cycling through existing sizes by using the Image menu.)
Set your icons as desired. A 16x16 size will be used withen the taskbar entry and window title bar. A 32x32 size will be used as the main program icon (most likely)

Set the program icon:
Under the project name in the solution explorer will be a grayed folder called "Properties" open it. Under the Application tab is a section for the Icon/Resources. Select your desired icon.

Set the taskbar entry icon and window title bar icon:
Open up the desired form in designer mode. Select the actual form itself. In the properties window scroll to the icon section. Select your icon. (Optionally you can find the "ShowIcon" and "ShowInTaskbar" options and change them as desired)

This took awhile for me to figure out, hopefully it helps the rest of you.
May 17 '07 #1
1 47580
7,872 Expert 4TB
I have made a test icon, it contains a 16x16, a 32x32, a 48x48, a 64x64 and a 96x96 image, each labeled with the number of their dimension.
You can use it to view which icon sizes are used by which control/components
Attached Files
File Type: zip DemoIcon.zip (540 Bytes, 3516 views)
Feb 8 '08 #2

Post your reply

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

Similar topics

1 post views Thread by Dino M. Buljubasic | last post: by
reply views Thread by danipeer | last post: by
4 posts views Thread by TEK | last post: by
2 posts views Thread by Ashutosh | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.