![]() |
| ||
| changing color of a pushbutton on a dialog box Hi, I want to change the color of my button during runtime.. i am writing the following code inthe OnCtlColor of my dialog box HBRUSH CPIVSyncDlg::OnCtlColor(CDC *pdc,CWnd *pwnd,UINT nCtlColor) the button is IDC_STARTSTOP i want to turn it red..but the interesting thing is the whole dialog box turns red except the buttons... i have searched the msdn library and I am following all the instruction given in example ...all in vein... any suggestion would be helpful.. thanks, Hardik |
| ||
| Re: changing color of a pushbutton on a dialog box the method in "How do I change the background color of a control?" will not work for buttons! If you want to change the color of a dialog button, you have to use an owner-draw button. (You can use bitmap buttons.) Changing the color through OnCtlColor() will not work for buttons. The following Knowledge Base articles may be of help to you: Q32685, "Using the WM_CTLCOLOR Message," Quote:
|
| ||
| Re: changing color of a pushbutton on a dialog box What is here m_btbrush and m_hbrush ? I got an error with this code like this : error C2228: left of '.GetSafeHandle' must have class/struct/union |
| All times are GMT -4. The time now is 7:12 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC