Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB RichTextBox

Status
Not open for further replies.

Cap2010

Programmer
Mar 29, 2000
196
0
0
CA

I have some text in a RichTextBox, and want to determine how big to make the box to ensure that all of the text is visible with no scroll bars
 
U can't, that's because the rich text box show proportional fonts (u know, the i and m and other have a different size).
 
Some objects (e.g. PictureBox, Printer, Form) allow you to use the TextWidth method to determine the length of the text using that object's font. RichTextBox is not one of those objects, but if you had one of those objects in your project with the same font as the rich text you could use the method on that object to determine the length.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top