stin
asked on
Displaying a Button
I created a button class in classwizard that inherits from CButton. I then displayed it by calling create. However, when I override OnPaint(), it no longer displays the
button. Calling CButton::OnPaint() does not seem to help. What must I do? Thanks.
button. Calling CButton::OnPaint() does not seem to help. What must I do? Thanks.
What is the code you have in OnPaint? Do you call BeginPaint and EndPaint?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I did override OnPaint() using classwizard. I did not call BeginPaint() or EndPaint(), I simply wanted to change the font. What I'm trying to do is read a list of strings from a DB and then create an array of buttons, one for each string. I created an array of buttons, and called Create() for each of the buttons. This seemed to work fine. Then, when I overrode OnPaint() using classwizard my buttons disappeared. How can I change the font while also keeping the default OnPaint() functionality? Thanks
You will have to do the work of painting the button youself. That means using BeginPaint and EndPaint etc.