Solved

calculating size of a text in dialog

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

There are two main kinds of selectors in CSS: One is base selector like h1, h2, body, table or any existing HTML tags.  For instance, the following rule sets all paragraphs (<p> elements) to red: (CODE) CSS also allows us to define our own custom …
It's sometimes a bit tricky to use date functions in Oracle BPEL. I'll explain quickly how you can add N days to the current date. In a BPEL process this can be useful, and you can adapt it to fit your needs. First of all, let's see how to add 1 …
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

747 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