473,223 Members | 1,805 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,223 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 6508
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....
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.