khaos11
khaos11

Reputation: 63

Changing Form's Icon in Visual Studio 2012 C#

I am trying to change the icon of the form (top left) and any other place I see little squares default icon.

I have tried:

Note at first the Background Image I had selected for the form wasn't applying either - I would change it via the form - Properties - Appearance - BackgroundImage - Select from computer. Would show as changed but as soon as I would debug or publish or would not be there. -Added it to my resources and then chose it from the BackgroundImage browse - chose it from project resources and then it worked.

Upvotes: 1

Views: 9297

Answers (2)

khaos11
khaos11

Reputation: 36

Found a solution: With the idea that my Background image wasn't working until I had it in the Resources. I went to the Form1_load event and added the following code:

System.Drawing.Icon ico = Properties.Resources.Untitled;
this.Icon = ico;

As "Properties.Resources.Untitled" being my icon that I added to my Resources.

And now seems to be workings as wanted.

Upvotes: 2

Casperah
Casperah

Reputation: 4564

You need to change the icon on every form as well using the Icon property of the Form.

Upvotes: 1

Related Questions