Re: transparent CheckBox/radioBox
- From: "David Ching" <dc@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 12 Feb 2008 15:37:10 GMT
"D@na" <Dna@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:BBF5389F-C6CD-4152-8AA0-477EE265ADE1@xxxxxxxxxxxxxxxx
hello All..
there is something weird in my project when dealing with transparent
checkbox or radio box.. I wanna have a transparent-background CheckBox and
RadioBox
I ve tried using owner draw and implement WM_CTLCLR. The checkbox/radiobox
background will turn to black if i set my project Unicode-support. But,
everything work well if i work in a non-unicode project. Since i need to
support
Unicode, its so troublesome.
I dont get what's happening, so need your expertist ..FYI, Im using visual
studio 2005
thanks in advance
I have UNICODE project with transparent checkboxes and radio buttons. But
only the text to the right of these controls are transparent. The actual
checkbox/radio button can't be transparent (or at least I haven't found a
way). In fact, I have code that has:
HBRUSH CBaseWnd::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CWnd::OnCtlColor(pDC, pWnd, nCtlColor);
DWORD dwStyle = pWnd->GetStyle();
if ( dwStyle &
(BS_AUTORADIOBUTTON | BS_RADIOBUTTON | BS_AUTOCHECKBOX |
BS_CHECKBOX) )
{
// Radio buttons and checkboxes have ugly gray backgrounds that
// stick out when placed over a white background; paint the
background
// in white for a better blend
hbr = (HBRUSH) GetStockObject (WHITE_BRUSH);
}
return hbr;
}
So I explicitly set the color of the checkbox/radio button here.
-- David
.
- Follow-Ups:
- Re: transparent CheckBox/radioBox
- From: jacadcaps
- Re: transparent CheckBox/radioBox
- Prev by Date: Re: GetCurrentBitmap from a rect in the DC
- Next by Date: Re: How can I rename a database table?
- Previous by thread: Re: GetCurrentBitmap from a rect in the DC
- Next by thread: Re: transparent CheckBox/radioBox
- Index(es):