Solved

calculating size of a text in dialog

Posted on 1997-10-23
2
208 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
2 Comments
 
LVL 1

Accepted Solution

by:
winmeister earned 100 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

When you work with shopping cart / ecommerce relates web sites, you need to pass the certain form post details to the payment gateway process page with required details for the products items you give to order. Also you may need to track the ordered…
I will show you how to create a ASP.NET Captcha control without using any HTTP HANDELRS or what so ever. you can easily plug it into your web pages. For Example a = 2 + 3 (where 2 and 3 are 2 random numbers) Session("Answer") = 5 then we…
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:
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

895 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now