Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

style of a CStatic

Status
Not open for further replies.

tzzdvd

Programmer
Aug 17, 2001
52
IT
Is it possible to change the style of a CStatic run-time (for example make sunken)?
I tried to use
ModifyStyleEx(0, WS_EX_CLIENTEDGE)
but it doesn't work

Thank's for all
Davide
 
I am not sure... but you may have to call UpdateData(FALSE) after you set it

matt
 
I had already tried but it didn't work.
Thank's the same
Davide
 
Use ClassWizard to create a class derived from CStatic. Use the wizard to coverload the PreCreateWindow() member function:
class CMyStatic : public CStatic
{
...
protected:
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
...
};

BOOL CMyClass::preCreateWindow(CREATESTRUCT& cs)
{
// TODO: Add your specialized code here and/or call the base class
cs.dwStyle |= WS_EX_CLIENTEDGE;
return baseCEditResponseCode::preCreateWindow(cs);
}

HTH
Shyan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top