Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 1998-02-12
2
Medium Priority
?
224 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 200 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…

876 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