Is there any way to set the same icon to all my forms without having to change one by one?
Something like when you setup GlobalAssemblyInfo for all your project
I wasn't sure if I wanted to use inheritance here, so I used an extension method:
public static class MyExtensionMethods
{
public static void SetAppIcon(this Form form)
{
form.Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath);
}
}
Then in any form's constructor:
this.SetAppIcon();
Note: this will cause a crash if you try to run the application from a network location