Adding a background image to a to a button.

B

Bredal Jensen

I have added an image as a background of my buttuon in my windows form
application.

The ide has added the following code:

this->button1->BackgroundImage = (__try_cast<System::Drawing::Image *
(resources->GetObject(S"button1.BackgroundImage")));





this results into the following error:

...\Form1.h(68): error C2039: 'GetObjectA' : is not a member of
'System::Resources::ResourceManager'


well i'm new to this and this not make so much sense to me . Especially when
the compiler complains about code the ide has added for me;)


Any help will be highly appreciated.


Jensen
 
R

Ronald Laeremans [MSFT]

#undef GetObject somewhere before the line with the GetObject call. Or some
more sophisticated version using push and pop for the macro.

Ronald Laeremans
Visual C++ team
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top