Solved

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

Posted on 1997-04-14
1
305 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article surveys and compares options for encoding and decoding base64 data.  It includes source code in C++ as well as examples of how to use standard Windows API functions for these tasks. We'll look at the algorithms — how encoding and decodi…
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

773 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