471,306 Members | 1,203 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,306 software developers and data experts.

Setting app wide icon?

I'd like to use the same icon for my project's EXE file and forms. The
icon may change so I need a way to put the icon file name in a variable
and assign it to the icon propery of all forms. When assigned at
design time, the following code is generated:

this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this. Icon")));

How can I do this dynamically at run time via a variable.

Thanks,
Brett

Feb 1 '06 #1
1 1361
Make sure that the icon file always has the same name and that it is located
in the same directory as the program. If you want to replace the icon with
a new one then just copy the new icon to the program directory and make sure
that it has the same name. You will of course have to delete the old icon,
or move it first.

"Brett Romero" <ac*****@cygen.com> wrote in message
news:11*********************@g44g2000cwa.googlegro ups.com...
I'd like to use the same icon for my project's EXE file and forms. The
icon may change so I need a way to put the icon file name in a variable
and assign it to the icon propery of all forms. When assigned at
design time, the following code is generated:

this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this. Icon")));

How can I do this dynamically at run time via a variable.

Thanks,
Brett

Feb 1 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by Grant Edwards | last post: by
1 post views Thread by Ahmet | last post: by
1 post views Thread by Dick | last post: by
Plater
1 post views Thread by Plater | 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.