Solved

How to match a bitmap and a checkbox (radiobutton) in a window ?

Posted on 1997-04-14
1
303 Views
Last Modified: 2013-12-03
Hi,

      I draw a bitmap in a window and i want to use checkbox and radiobutton within this window. How can i do to match these two window controls background color with my bitmap ? In theory, i must initialize the background color of these controls to Transparent to prevent these backgrounds to overwrite the bitmap, so, the only things you can see are the text (checkbox & radiobutton) and the mark.
Must i use WM_CTLCOLOR, in which way ......

Thanks
0
Comment
Question by:mars
1 Comment
 
LVL 15

Accepted Solution

by:
NickRepin earned 50 total points
ID: 1334597
I don't know, what programming system you use: OWL, MFC...
But here common answer.

In your window's procedure you must process WM_CTLCOLORBTN message:
 
 case WM_CTLCOLORBTN:
     HWND hButton=(HWND) lParam;
     // Here make sure hButton is your bitmap's check/radiobutton handle
     // .....
     // Create background brush
     HGDIOBJ hBrush=GetStockObject(NULL_BRUSH);
     return (LRESULT) hBrush;
 
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

707 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