Click here to Skip to main content
15,887,135 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
I created an application recently and i wanted to assign my own Icon to the application executable.
I did that through project Options.
Then i realised that my frmMain Icon did not change and i was forced to add the icon to a resource as well in Order for the Main Form to use it.

by something like
C#
public frmMain()
{
    InitializeComponent();
    Icon = Properties.Resources.Appico;
}


This way though the Ico file is stored twice inside the application executable. Is there any possible way to avoid this? I mean the duplicate file storage (it kinda doubles the application file size not that i cant cope without any other way of doing it, i just have a feeling that there must be a better way).
Posted

1 solution

The icon for the executable is stored as a Win32 Resource, whereas the icon used on the form is stored as a .Net resource.
You cannot use one for the other.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900