Solved

active x

Posted on 1998-12-07
1
180 Views
Last Modified: 2013-11-25
i will implement a active-x control that acts as a control ampel with four state (red green yellow white) i create active-x contron that is subclassed of button and will display a bitmap for any state(red ....) how can i load the
bitmp on button.
0
Comment
Question by:saidi
1 Comment
 
LVL 8

Accepted Solution

by:
Answers2000 earned 50 total points
Comment Utility
1. Make sure the button has BS_BITMAP style
2. Load the bitmap with
SendMessage( m_hWnd, BM_SETIMAGE, (WPARAM)IMAGE_BITMAP, (LPARAM)hBitmap ),

Use LoadBitmap to load the bitmap from resources, e.g.
HBITMAP hBitmap = LoadBitmap( IDB_BITMAP1 ) ;

3. If you simply want to paint the button, override OnDraw, then you can use FillSolidRect to paint the button with your chosen color.

0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
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.

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

16 Experts available now in Live!

Get 1:1 Help Now