calculating size of a text in dialog

I want to base the width of a modeless dialog on the length of a text string I write in the dialog.  How do I calculate the length?  My guess is to override EvPaint() and use GetTextExtent(,,), but my dialog seems to ignore my new EvPaint().  What is the proper way to figure out the text length, and is there something special I have to do to get EvPaint() to work?
danbindAsked:
Who is Participating?
 
winmeisterConnect With a Mentor Commented:
In SetupWindow method create a TClientDC. Then get the text size with GetTextExtent, and resize the dialog.
0
 
danbindAuthor Commented:
thanks!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.