Solved

How to use CBitmapButton dynamically

Posted on 1998-05-03
1
321 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
1 Comment
 
LVL 23

Accepted Solution

by:
chensu earned 50 total points
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
VBA "SendKeys" Syntax for Multiple Keystrokes 7 97
tripleUp challenge 7 65
NotAlone Challenge 20 70
unix example issues 18 44
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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…
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.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

743 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

17 Experts available now in Live!

Get 1:1 Help Now