?
Solved

calculating size of a text in dialog

Posted on 1997-10-23
2
Medium Priority
?
234 Views
Last Modified: 2013-12-26
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?
0
Comment
Question by:danbind
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 1

Accepted Solution

by:
winmeister earned 300 total points
ID: 1299448
In SetupWindow method create a TClientDC. Then get the text size with GetTextExtent, and resize the dialog.
0
 

Author Comment

by:danbind
ID: 1299449
thanks!
0

Featured Post

Video: Liquid Web Managed WordPress Comparisons

If you run run a WordPress, you understand the potential headaches you may face when updating your plugins and themes. Do you choose to update on the fly and risk taking down your site; or do you set up a staging, keep it in sync with your live site and use that to test updates?

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question