Solved

calculating size of a text in dialog

Posted on 1997-10-23
2
228 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 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

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Question has a verified solution.

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

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…
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
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…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

705 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