Solved

VC++4.0: How to lay a .bmp over a button

Posted on 1998-02-12
2
211 Views
Last Modified: 2010-05-18
Using VC++4.0, I have developed a remote control for a camera.
To move the pan/tilt, I use buttons like up/down/left etc.

Now I would like to replace the words "up", "down"...with arrows.
I tried to lay a selfmade .bmp over the button, but it didn't work.

Hope this is not a big problem...till now I used the default control elements from VC++ with individual caption.

Any help would be appreciated !

-Stavi-

In case this is a difficult question, I'll increase the points...
0
Comment
Question by:mitrakis
2 Comments
 
LVL 7

Accepted Solution

by:
galkin earned 50 total points
ID: 1181896
Use CBitmapButton class to set up to 4 bitmaps for each button for enable, disable focused and pushed state of the button. If you want to place only one bitmap on each button the simpliest way to do this is to use ordinary button and call CButton::SetBitmap.
0
 
LVL 3

Author Comment

by:mitrakis
ID: 1181897
Hi galkin,

hope you read this comment...

I need only one bitmap for the button.
So, this is what I changed in my C++ code:

BOOL CDiaKamera::Create()
{
      CButton* pButton;
      BOOL ret;
      
      ret = CDialog::Create(CDiaKamera::IDD);
      pButton = (CButton*) GetDlgItem(IDC_Home);
      pButton->SetBitmap((HBITMAP) GetDlgItem(IDB_HOME));
      return ret;
}

- IDC_Home is my button ID
- IDB_HOME is my bitmap I want to place over this button

...nothing happens...

Do I have to "redraw" the dialog to update the buttons ?

what's wrong here ?

-Stavi-
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

813 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