Solved

How to use CBitmapButton dynamically

Posted on 1998-05-03
1
327 Views
Last Modified: 2013-11-19
I would like to create a CBitmapButton dynamically and place it in some coordinates. I have my bitmaps in resources and I don't have any button created in my dialog, who is itself dynamically created.
0
Comment
Question by:fmichaud061597
[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
1 Comment
 
LVL 23

Accepted Solution

by:
chensu earned 50 total points
ID: 1306364
1. Define a member variable of your dialog box class as follows:
   CBitmapButton m_bmpBtn;
2. In your overridden OnInitDialog() function:
   m_bmpBtn.Create("Bitmap Button", BS_PUSHBUTTON | BS_OWNERDRAW, rect, this, ID_BMPBTN);
   m_bmpBtn.LoadBitmaps(ID_BMP1, ID_BMP2, ID_BMP3, ID_BMP4);
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

Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…

696 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