Link to home
Start Free TrialLog in
Avatar of judico
judico

asked on

Changing an icon

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?
ASKER CERTIFIED SOLUTION
Avatar of nonubik
nonubik

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of judico
judico

ASKER

Thank you for the help. One crucial line which should also be added to the code is:

#undef GetObject

For more details please take a look at:

http://www.dotnet247.com/247reference/msgs/36/184054.aspx
thanks judico good luck to you for the future, i am glad we helped you

pjcrooks2000