Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 1998-02-12
2
Medium Priority
?
221 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
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 viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
Suggested Courses

704 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