Solved

Changing an icon

Posted on 2004-09-03
4
177 Views
Last Modified: 2010-04-01
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?
0
Comment
Question by:judico
  • 2
4 Comments
 
LVL 16

Accepted Solution

by:
nonubik earned 63 total points
ID: 11973030
You ca change all the icons for your app. Just go to resource editor and chnge from there. Be aware that are more icon types (16x16, 32x32, etc) with different number of colors (16, 256, etc).

>I was able to change the icon of the application by replacing the default app.ico with a custom made one
I suppose you changed with an icon file containing onl a 32x32 icon, not 16x16 and the rest
0
 
LVL 8

Assisted Solution

by:pjcrooks2000
pjcrooks2000 earned 62 total points
ID: 11973451
Yes add it through the resource editor to your project then change the name for it wherever you it has been declared in the main app.

This link should put your rignt on the right tract you need to go down
http://www.codeproject.com/gdi/replaceicon.asp

good luck with it

pjcrooks2000
0
 

Author Comment

by:judico
ID: 11979541
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
0
 
LVL 8

Expert Comment

by:pjcrooks2000
ID: 11979880
thanks judico good luck to you for the future, i am glad we helped you

pjcrooks2000
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now