473,408 Members | 1,744 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,408 software developers and data experts.

Updating Application Icon

I have a Windows application that previously had the company logo
"MyCompany.ico" added to the upper left-most corner. The company has since
issued a new version of "MyCompany.ico" that looks completely different.

I overwrote the old ico file with the new ico file and re-ran the program. I
still see the old logo at run-time.

I right-clicked the project-> Add Existing Item-> added the new ico file. I
set the build action to Embedded Resource, and the Copy to Output to Copy
Always. I still see the old logo at run-time.

I right-clicked my project and selected properties. In the Application tab,
I selected my new Icon file. I see the new Icon appear to the right of the
elipse button. I STILL see the old icon at the upper left-most corner at run
time.

I added the following line to my start-up project constructor:

this.Icon = new Icon(@"..\..\MyCompany.ico");

This worked. I see the new logo at the upper left-most corner at run-time.

I'd really like to know why the other options didn't work. Please don't
answer unless you've actually tried this recently in Visual Studio 2005. I've
been at this a long time, and this is the first time I've had this much
trouble. I'm sure people are going to ask me why the first attempts didn't
work.

Thanks,
--
Randy
Jun 23 '06 #1
4 6520
randy1200 wrote:
I have a Windows application that previously had the company logo
"MyCompany.ico" added to the upper left-most corner. The company has since
issued a new version of "MyCompany.ico" that looks completely different.

I overwrote the old ico file with the new ico file and re-ran the program.
I still see the old logo at run-time.

I right-clicked the project-> Add Existing Item-> added the new ico file.
I set the build action to Embedded Resource, and the Copy to Output to
Copy Always. I still see the old logo at run-time.

I right-clicked my project and selected properties. In the Application
tab, I selected my new Icon file. I see the new Icon appear to the right
of the elipse button. I STILL see the old icon at the upper left-most
corner at run time.

I added the following line to my start-up project constructor:

this.Icon = new Icon(@"..\..\MyCompany.ico");

This worked. I see the new logo at the upper left-most corner at run-time.

I'd really like to know why the other options didn't work. Please don't
answer unless you've actually tried this recently in Visual Studio 2005.
I've been at this a long time, and this is the first time I've had this
much trouble. I'm sure people are going to ask me why the first attempts
didn't work.

Thanks,


Hi Randy,

You may have updated the icon on the hard-drive, and even added it as an
embedded resource... but that's not how it becomes part of a form's icon.
A form has a property 'Icon', which you correctly assigned to, in order to
change the icon. The value of this property, when updated with the
designer is stored in a resource file, and not directly referenced from the
disk. You need to either update the form's resource file, with the new
icon, or simply browse for the new icon on your hard-drive, by means of the
Property Viewer (assuming you're using the Windows Forms Designer).

Does this answer your question?
-- Tom Spink
Jun 23 '06 #2
Thanks for the replay.

I commented out the this.Icon = new Icon(@"..\..\MyCompany.ico");

This brings me back to the previous icon displayed at run-time.
You need to either update the form's resource file, with the new
icon, or simply browse for the new icon on your hard-drive, by means of the
Property Viewer (assuming you're using the Windows Forms Designer).
<<<

How do I update the form's resource file? I tried right-clicking
Rsources.resx and selecting Refresh. No effect. Also, there's no explicit
reference to MyCompany.ico in either Resoucres.resx or Resources.Designer.cs.
MyCompany.ico is listed as a file in the solution explorer.

Is the property viewer what I get from right-clicking the project,
application tab, Resource Group, Icon? Again, I browse to the new icon, and
see it in the preview to the right of the browse button, but not at run-time.

Is it possible that the size of the file is causing problems with the two
methods above. The file size is 25 k. I believe the file is valid because it
displays using the "new Icon" line is the constructor.
Thanks,
--
Randy
"Tom Spink" wrote:
randy1200 wrote:
I have a Windows application that previously had the company logo
"MyCompany.ico" added to the upper left-most corner. The company has since
issued a new version of "MyCompany.ico" that looks completely different.

I overwrote the old ico file with the new ico file and re-ran the program.
I still see the old logo at run-time.

I right-clicked the project-> Add Existing Item-> added the new ico file.
I set the build action to Embedded Resource, and the Copy to Output to
Copy Always. I still see the old logo at run-time.

I right-clicked my project and selected properties. In the Application
tab, I selected my new Icon file. I see the new Icon appear to the right
of the elipse button. I STILL see the old icon at the upper left-most
corner at run time.

I added the following line to my start-up project constructor:

this.Icon = new Icon(@"..\..\MyCompany.ico");

This worked. I see the new logo at the upper left-most corner at run-time.

I'd really like to know why the other options didn't work. Please don't
answer unless you've actually tried this recently in Visual Studio 2005.
I've been at this a long time, and this is the first time I've had this
much trouble. I'm sure people are going to ask me why the first attempts
didn't work.

Thanks,


Hi Randy,

You may have updated the icon on the hard-drive, and even added it as an
embedded resource... but that's not how it becomes part of a form's icon.
A form has a property 'Icon', which you correctly assigned to, in order to
change the icon. The value of this property, when updated with the
designer is stored in a resource file, and not directly referenced from the
disk. You need to either update the form's resource file, with the new
icon, or simply browse for the new icon on your hard-drive, by means of the
Property Viewer (assuming you're using the Windows Forms Designer).

Does this answer your question?
-- Tom Spink

Jun 23 '06 #3
randy1200 wrote:
Thanks for the replay.

I commented out the this.Icon = new Icon(@"..\..\MyCompany.ico");

This brings me back to the previous icon displayed at run-time.

You need to either update the form's resource file, with the new
icon, or simply browse for the new icon on your hard-drive, by means of
the Property Viewer (assuming you're using the Windows Forms Designer).
<<<

How do I update the form's resource file? I tried right-clicking
Rsources.resx and selecting Refresh. No effect. Also, there's no explicit
reference to MyCompany.ico in either Resoucres.resx or
Resources.Designer.cs. MyCompany.ico is listed as a file in the solution
explorer.

Is the property viewer what I get from right-clicking the project,
application tab, Resource Group, Icon? Again, I browse to the new icon,
and see it in the preview to the right of the browse button, but not at
run-time.

Is it possible that the size of the file is causing problems with the two
methods above. The file size is 25 k. I believe the file is valid because
it displays using the "new Icon" line is the constructor.
Thanks,


Hi Randy,

I'm sure the file is valid. If you expand the form in the Solution Viewer,
it should show you a specific resources file for that form. I believe if
you open that, you'll be able to re-import the icon file.

When you have the form open in Design-View, you should just be able to
change the 'Icon' property of the form, using the 'Property Viewer'. The
property viewer should be underneath the Solution Explorer... hit F4 on
your keyboard, while the form is open, if it's not.

Hope this helps,
-- Tom Spink
Jun 23 '06 #4
Now I see it. That was extremely helpful. Many, many thanks...
--
Randy
"Tom Spink" wrote:
randy1200 wrote:
Thanks for the replay.

I commented out the this.Icon = new Icon(@"..\..\MyCompany.ico");

This brings me back to the previous icon displayed at run-time.
>

You need to either update the form's resource file, with the new
icon, or simply browse for the new icon on your hard-drive, by means of
the Property Viewer (assuming you're using the Windows Forms Designer).
<<<

How do I update the form's resource file? I tried right-clicking
Rsources.resx and selecting Refresh. No effect. Also, there's no explicit
reference to MyCompany.ico in either Resoucres.resx or
Resources.Designer.cs. MyCompany.ico is listed as a file in the solution
explorer.

Is the property viewer what I get from right-clicking the project,
application tab, Resource Group, Icon? Again, I browse to the new icon,
and see it in the preview to the right of the browse button, but not at
run-time.

Is it possible that the size of the file is causing problems with the two
methods above. The file size is 25 k. I believe the file is valid because
it displays using the "new Icon" line is the constructor.
Thanks,


Hi Randy,

I'm sure the file is valid. If you expand the form in the Solution Viewer,
it should show you a specific resources file for that form. I believe if
you open that, you'll be able to re-import the icon file.

When you have the form open in Design-View, you should just be able to
change the 'Icon' property of the form, using the 'Property Viewer'. The
property viewer should be underneath the Solution Explorer... hit F4 on
your keyboard, while the form is open, if it's not.

Hope this helps,
-- Tom Spink

Jun 23 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

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...
3
by: Sam | last post by:
I've been googling for a couple of hours now and tried some different things, but I've been unable to get the icon for a distributed access application to do anything but display the default...
3
by: Wayne | last post by:
I currently have an app whose Icon I am setting. I want to set the icons in my forms at run time to that of the application icon. How do I retrieve the application Icon so that I can use it for my...
2
by: Elad Gutman | last post by:
Hi Everyone, I'm facing an annoying problem and any help will be most appreciated . .. . I have a main application form and its icon is functioning excellent: it appears both in the taskbar...
6
by: Paul | last post by:
In other development environments i've used the IDE had facilities to create custom icons for the application and files it created. It would be nice to have a custom icon for a created file, but...
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: 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
by: Avnish | last post by:
Hi, I have created an form based application in c# having some GUI. I have also added localization support to it due to GUI changes for different customers.Now the issue I have the Application...
0
by: developer77 | last post by:
Hi, Im using VS2005 vb.net . If I set the application icon to a known good icon , with all reasonable embedded sizes (16x16, 32x32, 64x64. 128x128, 256x256) then its not showing correctly in win 7....
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?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.