Setting app wide icon?

B

Brett Romero

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
 
B

Brooke

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top