By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,181 Members | 1,026 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,181 IT Pros & Developers. It's quick & easy.

Need help RichTextBox Resizing

P: 6
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
Share this question for a faster answer!
Share on Google+

Post your reply

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