471,354 Members | 1,558 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,354 software developers and data experts.

Need help RichTextBox Resizing

I just developing a editor. I have provide the options like Bold, Italic, underlin, font change, font size change. These font options are keep in with one toolstripbutton. the toolstripbar keep inside with panel.

The RichTextBox keep inside with other panel. The panel height and width is same with RichTextBox. The RichTextBox both scrolling options are make it as false.

I done the coding for RichTextBox's height to fit with the text. that is when the user typing text line goes beyound the the RichTextBox hight, then the RichTextBox height will increase as same when user delete a line then the height will decrese upto the user specified height(original height of the RichTextBox). when the RichTextBox height goes beyound the panel height than the panel's Vertical ScrollBar is enabled. The user can change the font size of the text change by the toolstripbar option, that font options are always keep when the RichTextBox focused. when the user change any option on font information it will calculated when the RichTextBox resize.

eg: when the user set the size of the font height as 25. Then the RichTextBox height increment ratio is 25pt.

My problem is when I paste some text inside the RichTextBox the height of the RichTextBox not fit with the text. Because I am not able to know the font information and number of line which is in Clipboard.

The other problem is I use the following events

void richTextBox1_ContentsResized(object sender, ContentsResizedEventArgs e) {

this.richTextBox1.Height = e.NewRectangle.Height;


Even I am not get the proper result

I am developing this entire think as usercontrol.
May 14 '07 #1
0 1865

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by nouno | last post: by
3 posts views Thread by kangoo | last post: by
12 posts views Thread by M O J O | last post: by
3 posts views Thread by Tom Sweet | last post: by
9 posts views Thread by James Wong | last post: by
reply views Thread by Robert | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.