|
-
May 6th, 2006, 09:53 AM
#1
Thread Starter
Addicted Member
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|