Changing an icon
Posted on 2004-09-03
I'd like to change the icon both of the application and of the individual forms (the small icon which appears at the upper left corner of the forms).
I was able to change the icon of the application by replacing the default app.ico with a custom made one. Unfortunately, this doesn't replace the small icons which appear on the upper left corner of the form. When I try to change the icon in the property sheet the following error appears upon compilation:
error C2039: 'GetObjectA' : is not a member of 'System::Resources::ResourceManager'
To avoid the above error in changing these small icons I wrote the following code into the constructor:
System::Drawing::Icon *IC = new System::Drawing::Icon("app.ico");
this->Icon = IC;
Interestingly, this compiles well despite the following error appearing in the task list:
'The variable 'IC' is either undeclared or was never assigned.'
What is even worse, I can't get the compiled .exe file to work. How is this problem fixed?