How can change color of dialog box
-
Hi All. How can we chnage default color to our own color of a dialog box in MFC Dialog based applications. Thanaking You all Shesahidar Patnam
sheshidar wrote:
How can change color of dialog box
Override WM_CTLCOLOR.
HBRUSH COnlyForYou::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) { HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor); HBRUSH BkgBrush = ::CreateSolidBrush(RGB(0,0,255)); if(GetSafeHwnd()==pWnd->GetSafeHwnd()) { pDC->SetBkColor(RGB(0,0,255)); hbr = BkgBrush; } return hbr; }
Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_
-
sheshidar wrote:
How can change color of dialog box
Override WM_CTLCOLOR.
HBRUSH COnlyForYou::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) { HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor); HBRUSH BkgBrush = ::CreateSolidBrush(RGB(0,0,255)); if(GetSafeHwnd()==pWnd->GetSafeHwnd()) { pDC->SetBkColor(RGB(0,0,255)); hbr = BkgBrush; } return hbr; }
Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_
-
You dont need to call this event you need to insert this event to your class
_**
**_
WhiteSky
-
sheshidar wrote:
how I have to call this function.
You can use class wizard to add the code for you. The framework calls this member function when a child control is about to be drawn.
Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_
-
You dont need to call this event you need to insert this event to your class
_**
**_
WhiteSky