Results 1 to 1 of 1

Thread: Calculate 'textheight' of RichtextBox

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2002
    Posts
    130

    Calculate 'textheight' of RichtextBox

    Hello,

    I need to have a richtextbox fit to text. In other words I need to calculate it's height to adjust according to how much text is in it.

    The RTB will have different font sizes in it. -So it isn't just a matter of getting the lines and multiply it by Form1.FontSize("X") .

    I have made a project (see attachement 4.zip / 3kB). It uses the richtextbox scrollbar (and GetScrollInfo -API) to calculate the textheight.

    The sample project works. But it needs a scrollbar, in other words the scrollbar must be visible.

    I need any ideas on how to get the textheight of a RTB by a better method, if this metod exists.
    Attached Files Attached Files
    • File Type: zip 4.zip (2.3 KB, 72 views)

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