I am struggling with how to change the main program icon during compilation. I know it can be changed in Visual Studio Project-> Properties -> Application -> and there is button Change icon.
Okay, how can I do exactly the same now without manually setting this icon? I just want to change it via the c# code. Is it possible at all?
Screen settings looks like this:
I tried this code in form load event , but it only changes icon after I start my application.
System.Drawing.Icon ico = new System.Drawing.Icon(FastFoodDemo.Properties.Resources.red_mark);
this.Icon = ico;
The question is : How can I change the application main icon during compilation without do it by hand like on the above screenshoot. Please don't make this post as duplicate, I searched a lot of webpages and couldn't find any solution in c#.