CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Guest

    Calculating lenght of text in a dialog control

    I am writing a program that analyses RC files and reports stuff like word
    count, number of resources, and so on. I would like to implement a function
    which reports clipped strings in controls (if the control is too small for
    the text). Does anybody know how to calculate the size of a control so the
    text will fit?

    Thanks.








  2. #2
    Join Date
    Apr 1999
    Posts
    23

    Re: Calculating lenght of text in a dialog control

    You can use the function called ::GetTabbedTextExtent() or ::GetTextExtent() to calculate the size of the text, you must pass in a handle to a DC so that it can get the font information about the text string.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured