form's icon

  • Thread starter Thread starter Vic
  • Start date Start date
V

Vic

I am trying to change an icon associated with my application's main form and
the application itself.

1. I selected my main form in IDE "Solution" tab and went to "Properties"
window.
2. I found "Icon" property, browsed for and selected a new icon.
3. I noticed the icon changed on my form
4. Ran my application and sure thing, the new icon replaced the default .NET
icon.

Several days after that I created yet another icon. I followed the same
steps (see above) to use the new icon, but all in vain. I do see the icon on
the form change in design view, but when I run my app, there is still the
old icon displayed.

I noticed, this is how my icon is loaded (code generated by IDE): asdasd

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

Looks like the icon is loaded from resources. Does it mean, that when I am
setting the new icon, my resources aren't updated? Is that a bug? Am I doing
something wrong?

Thanks for your help in advance.

Vic
 
Hi,

I have also experienced problems with altering the program icon in with the
designer. I would recommend loading the icon manually and assigning it to
the Icon property just after the form has been created.
 
Thanks, will do.

Dmitriy Lapshin said:
Hi,

I have also experienced problems with altering the program icon in with the
designer. I would recommend loading the icon manually and assigning it to
the Icon property just after the form has been created.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

Vic said:
I am trying to change an icon associated with my application's main form and
the application itself.

1. I selected my main form in IDE "Solution" tab and went to "Properties"
window.
2. I found "Icon" property, browsed for and selected a new icon.
3. I noticed the icon changed on my form
4. Ran my application and sure thing, the new icon replaced the default .NET
icon.

Several days after that I created yet another icon. I followed the same
steps (see above) to use the new icon, but all in vain. I do see the
icon
on
the form change in design view, but when I run my app, there is still the
old icon displayed.

I noticed, this is how my icon is loaded (code generated by IDE): asdasd

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

Looks like the icon is loaded from resources. Does it mean, that when I am
setting the new icon, my resources aren't updated? Is that a bug? Am I doing
something wrong?

Thanks for your help in advance.

Vic
 
Back
Top