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
Printable View
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
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