Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting / setting background colour of a control

Status
Not open for further replies.

Skute

Programmer
Jul 21, 2003
272
GB
Hi,

ive created a child dialog box for use in my tabs, but when i set the transparent property of the dialog, they still show up as gray.

so if you imagine it looks a little strange:

Gray background of application
White background of tabs
Gray background of child dialog for tab
White background for edit box.


So how can i emulate this manually by setting the background colour of the dialog box to the same background colour of the tab control?

Thanks
 
You can look at handling the WM_CTRLCOLORxxx messages.

Are you aware that removing your users ability to control colors is considered bad form in most cases?

-pete
 
Why wont the dialog box for the tab control appear transparent? Have i forgotten to enable something?

Ive got the extended style "WS_EX_TRANSPARENT" set for the dialogs, but they still appear with a grey background
 
Well since i have not found reason to ignore the UI guidelines i have no experience with this but my guess is that the MFC framework (base classes) for dialogs handle the WM_ERASEBKGND message and paint the background of the window with the default brush. Oh look, I just read the documentation for OnEraseBkgnd() and that’s almost exactly what it says [lol]


The default implementation erases the background using the window class background brush specified by the hbrBackground member of the window class structure.



-pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top