How do I set an Icon property

  • Thread starter Thread starter Thomas Wegener
  • Start date Start date
T

Thomas Wegener

Hi,

I have an file "painting.ico".
I use an class which has an "Icon" property.
How can I set this property.

I tried
- Build Action: embedded resource
But it crashed during the assignment
- class.Icon = new Icon("painting.ico");

Anybody know the right way?

Thanks in advance
Thomas
 
you can use this:
this.button1.Image = global::WindowsApplication1.Properties.Resources.a;

where a is the image in the resource file.



thank you.
 
Thanks it works.
Thomas

Mohammad Shalabi said:
you can use this:
this.button1.Image = global::WindowsApplication1.Properties.Resources.a;

where a is the image in the resource file.



thank you.
 

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

Back
Top