|
-
May 26th, 1999, 02:52 PM
#1
Fit StaticTextControl with text
I'm kinda new at this...i'm making the jump from VB to Visual C++ and was wondering how i would make the rect for a static text control "AutoSize" to my member variable CString.
Any help or source code would be helpful.
Thanks
Al
-
May 26th, 1999, 09:02 PM
#2
Re: Fit StaticTextControl with text
You could get a good idea of the width and height of the string by calling GetTextExtentPoint32(). You need to call CStatic::GetDC() to get the device context that you'll need for the first parameter. You may need to fudge a couple of pixels here and there to get a good fit, but this should get you on the right track. Also check the on-line help on GetTextExtentPoint32() for more info.
Regards,
Paul McKenzie
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
|