LHoffman
September 13th, 1999, 12:31 PM
I derived a new class from CButton. I also catch the ONPaint() method with in this new class. In another clsss I dynamically created a radio CButton. What I want to do is change the background color of this radio CButton to the system color. Which I can do with the following routine:
Here is how I create the radio button:
OP1CButton *theRadioButton = new OP1CButton;
theRadioButton->Create(theScriptXQuestion->cLabel, WS_CHILD | WS_VISIBLE | BS_RADIOBUTTON, theCEditRect, this, NULL);
Here is the ONPaint method:
void OP1CButton::OnPaint()
{
CPaintDC dc(this); // device context for painting
CRect rect;
GetClientRect(rect);
//Get system color.
DWORD systemColor = GetSysColor(COLOR_MENU);
dc.SetBkColor(systemColor);
}
Now what happens is I get a control tat I can't see until I click in the area of the control. Even the text doesn't show up......
What in the heck am I doing wrong?????
Thanks
-LHoffman
Here is how I create the radio button:
OP1CButton *theRadioButton = new OP1CButton;
theRadioButton->Create(theScriptXQuestion->cLabel, WS_CHILD | WS_VISIBLE | BS_RADIOBUTTON, theCEditRect, this, NULL);
Here is the ONPaint method:
void OP1CButton::OnPaint()
{
CPaintDC dc(this); // device context for painting
CRect rect;
GetClientRect(rect);
//Get system color.
DWORD systemColor = GetSysColor(COLOR_MENU);
dc.SetBkColor(systemColor);
}
Now what happens is I get a control tat I can't see until I click in the area of the control. Even the text doesn't show up......
What in the heck am I doing wrong?????
Thanks
-LHoffman