|
-
April 4th, 2008, 11:06 AM
#1
CStatic-Derived class won't paint background
Last post wasn't clear enough.
I need to paint the background of a CStatic control created dynamically this way:
-----------Code Snippet:------------------
CUnknownCtrl* pUnknown;
pUnknown = new CUnknownCtrl;
pUnknown->Create("Text", SS_CENTER | WS_CHILD | WS_VISIBLE | WS_GROUP, CRect(11,35,360,526), this, 0x31);
----------------------------------------------
Notice that CUnknownCtrl is a CStatic-derived mfc class.
I can't figure out how to set background color of the label created with this code, someone can help me?
Calling OnCtlColor inside CUnknownCtrl won't even be executed and OnPaint fails. Some idea?
Thanks for advance
-
April 4th, 2008, 02:03 PM
#2
Re: CStatic-Derived class won't paint background
Handle WM_ERASEBKGND in the CUnknownCtrl class
-
April 4th, 2008, 04:37 PM
#3
Re: CStatic-Derived class won't paint background
Thanks!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|