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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Background color

Status
Not open for further replies.

proguru

Programmer
Mar 31, 2001
19
0
0
PY
Hi
I have two questions

How can i change the background color of the main dialog in a dialog based application?

How can i change the background color of a formview class?

Thanks.
 
use
SetWindowLong(hDlg,GCL_HBRBACKGROUND, newValue);
John Fill
1c.bmp


ivfmd@mail.md
 
1. SetBkColor should also work.
You will need an handle/pointer to the DC which you can get with the GetDC function(API or MFC) if you do not have it.
The call to SetBkColor must be done in the OnDraw(or OnPaint method) or in the WM_PAINT message handler in SDK APPs

2. AfxRegisterWndClass is doing something similar in MFC programs. this must be called in the Create method.

Hope this helps, s-)

Blessed is he who in the name of justice and goodwill, sheperds the weak through the valley of darkness...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top