Customize ColorDialog
-
how to change the background color of a custom color dialog
-
how to change the background color of a custom color dialog
of course its not a good way but maybe its some helpful to you
class CMyDialog: public CColorDialog { public: DECLARE_DYNCREATE(CMyDialog) CMyDialog(); ~CMyDialog(); DECLARE_MESSAGE_MAP() afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor); }; IMPLEMENT_DYNCREATE(CMyDialog, CColorDialog) BEGIN_MESSAGE_MAP(CMyDialog, CColorDialog) ON_WM_CTLCOLOR() END_MESSAGE_MAP() CMyDialog::CMyDialog() { } CMyDialog::~CMyDialog() { } HBRUSH CMyDialog::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) { HBRUSH hbr = CColorDialog::OnCtlColor(pDC, pWnd, nCtlColor); LOGBRUSH logBrush; logBrush.lbStyle = BS_HATCHED; logBrush.lbColor = RGB(100, 192, 192); logBrush.lbHatch = HS_CROSS; if(pWnd==this) SetWindowText("Test"); return CreateBrushIndirect(&logBrush); }
_**
**_
whitesky
-
of course its not a good way but maybe its some helpful to you
class CMyDialog: public CColorDialog { public: DECLARE_DYNCREATE(CMyDialog) CMyDialog(); ~CMyDialog(); DECLARE_MESSAGE_MAP() afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor); }; IMPLEMENT_DYNCREATE(CMyDialog, CColorDialog) BEGIN_MESSAGE_MAP(CMyDialog, CColorDialog) ON_WM_CTLCOLOR() END_MESSAGE_MAP() CMyDialog::CMyDialog() { } CMyDialog::~CMyDialog() { } HBRUSH CMyDialog::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) { HBRUSH hbr = CColorDialog::OnCtlColor(pDC, pWnd, nCtlColor); LOGBRUSH logBrush; logBrush.lbStyle = BS_HATCHED; logBrush.lbColor = RGB(100, 192, 192); logBrush.lbHatch = HS_CROSS; if(pWnd==this) SetWindowText("Test"); return CreateBrushIndirect(&logBrush); }
_**
**_
whitesky
is there any way to change the color of the buttons and the static texts??
-
is there any way to change the color of the buttons and the static texts??
See WM_CTLCOLORSTATIC_**
**_
whitesky