CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 1999
    Location
    Israel
    Posts
    140

    How to calculate Text Width?

    How can i evaluated text width?


  2. #2
    Guest

    Re: How to calculate Text Width?

    Use Len("YourText")
    Vlad


  3. #3
    Join Date
    Jul 1999
    Location
    Israel
    Posts
    140

    Re: How to calculate Text Width?

    I don't need the length of the string, i need the lengt of the string in pixels or twips


  4. #4
    Join Date
    Aug 1999
    Location
    India-Delhi
    Posts
    106

    Re: How to calculate Text Width?

    Hi....
    There are some function called textwidth and textheight. But before you use them, ypu have to tell computer about the font and font size so that textwidth and textheight could be calculated. Given below is a small example of using them.

    ...
    ...
    Printer.FontBold = true
    Printer.FontSize = 16
    Msg = "We all are computer professioanals let us help each other."
    textWidth = Printer.TextWidth(Msg)
    ...
    ...
    ...



    textwidth and textheight work with printer, form and picture object.

    I hope this answer the query.


    Santulan

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