Background color on Text Boxes and other controls
-
I have been able to change the background color on my Dialog box, but the background colors are still white on my text boxes and other controls. How does one change the background on those items? Thanks for your assistance.
John P.
-
I have been able to change the background color on my Dialog box, but the background colors are still white on my text boxes and other controls. How does one change the background on those items? Thanks for your assistance.
John P.
-
I have been able to change the background color on my Dialog box, but the background colors are still white on my text boxes and other controls. How does one change the background on those items? Thanks for your assistance.
John P.
-
I have been able to change the background color on my Dialog box, but the background colors are still white on my text boxes and other controls. How does one change the background on those items? Thanks for your assistance.
John P.
See
WM_CTLCOLOREDIT
_**
**_
WhiteSky
-
For edit box in onctlcolor OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) { if( CTLCOLOR_EDIT == nCtlColor ) { pDC->SetBkColor( RGB(250, 0, 0 )); }:) }
Dream bigger... Do bigger...Expect smaller aji
Thanks for the assistance!
John P.
-
In WM_CTLCOLOR message handler set background mode as transparent and return a null brush. This will make the background colour of the controls same as background colour of your dialog
Thanks for the help!
John P.
-
See
WM_CTLCOLOREDIT
_**
**_
WhiteSky
thanks WhiteSky.
John P.
-
thanks WhiteSky.
John P.
You can use
WM_CTLCOLOREDIT
like thisLRESULT CMyAnswer::OnCtlColorEdit(WPARAM wParam, LPARAM lParam) { HDC hdc = (HDC)wParam; SetBkMode(hdc,0); SetTextColor(hdc,TextColorEdit); // SetBkColor(hdc,RGB(53,97,200)); return (LRESULT)(m_pBrush->GetSafeHandle()); }
_**
**_
WhiteSky