Solved

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

Posted on 1998-02-12
2
216 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 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

Technology Partners: 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

This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

734 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