473,388 Members | 1,375 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 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 1428
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Grant Edwards | last post by:
I'm trying in vain to set the icon for the executable generated by py2exe. According to various sources there are two answers: 1) Do it on the command line: python setup.py py2exe --icon...
4
by: Tim Jarman | last post by:
Apologies in advance for the long post - I wanted to be sure I included all the relevant details. The answer is probably very, very simple. I am doing something stupid here, but I don't know what...
1
by: Ahmet | last post by:
In my application, I have statusbar on which i show icons. On some cases, I have to change icon of my statusbar to show different messages on panels. But I dont know how to change icon of one...
3
by: VJ | last post by:
I am trying to set my Form's Icon property at run time based on certain parameters. I have a imglist in the form for other purposes I would like to use the same image list to keep the Forms icon...
3
by: QLD_AU | last post by:
Is their a way in a VB.Net application to set all sub form icons to the main form ? or even set all icons to the Application icon, without having to reference the icon as a filename ? With...
1
by: hansolox1 | last post by:
The following program simply sets the icon of a form called form1. When I get the name of the embedded icon using GetManifestResourceNames(), I store the name in a string variable called s. The...
0
by: Nickneem | last post by:
I' m trying to disable all right mouse clicks by using the vbAccelerator Windows Hooks Library The small (systray / console) app. must catch all (right) mouseclicks before they are received by...
1
by: Dick | last post by:
I have a shared project that contains icons and bitmaps that are used throughout my suite of applications. I have to set Form.Icon, PictureBox.Image, etc. using code because the form designer...
1
Plater
by: Plater | last post by:
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....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.