How do I change the size of the font in my dynamically created CStatic?
Here's the call to create:Code:myStaticf[i]->Create(_T(Param[i]), WS_CHILD|WS_VISIBLE|SS_CENTER, CRect(x1,y,x2,y+h), this);
How do I change the size of the font in my dynamically created CStatic?
Here's the call to create:Code:myStaticf[i]->Create(_T(Param[i]), WS_CHILD|WS_VISIBLE|SS_CENTER, CRect(x1,y,x2,y+h), this);
Everything is relative...
I'm not too familiar with MFC (hawk, spit ), but flicking through MSDN, CStatic inherits SetFont from its CWnd base class. Assuming you have a HFONT lined up and called hfont:-
To change its size, you would have to use GetFont to get a CFont, then play with it a bit before SetFont.Code:myStaticf[i]->SetFont(CFont::FromHandle(hfont), TRUE);
I actually just decreased the size of the field and the text shrunk to fit it. ie:change h from 20 to 15, the text fit in it...Code:myStaticf[i]->Create(_T(Param[i]), WS_CHILD|WS_VISIBLE|SS_CENTER, CRect(x1,y,x2,y+h), this);
Everything is relative...