473,473 Members | 1,535 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Need help RichTextBox Resizing

6 New Member
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 2021

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

Similar topics

0
by: nouno | last post by:
I am trying to spell check a richtextbox. Through code (shown below) I save the contents of the richtextbox to a rtf file, open the rtf file in Word, spell check it, save it, and then load the ftf...
3
by: kangoo | last post by:
Hi, I'm trying to remove the last charater in a richTextBox. I though richTextBox.Text.Remove(richTextBox.Text.length-1, 1); would work, but it does nothing (eg richTextBox.Text += "some new...
5
by: Gary | last post by:
hi... how do I successfully resize a richtextbox within the main form, my code as follows... Private Sub frmMainForm_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles...
12
by: M O J O | last post by:
Hi, If I inside a thread creates a RichTextBox and only use this inside the thread, will there be any thread problems? I need to convert between Text and RTF inside a thread. Thanks!! M...
3
by: Tom Sweet | last post by:
Hi I know how to use the bitmap and graphics objects to create bitmaps and write text on them with the drawString method. I now need to create some BMPs of word or RTF docs. What would be the...
0
by: Vincent | last post by:
Dear all, I have implemented a class to export the content of RichTextBox to image in WYSISYG mode so that line breaks on the screen are the same as exported. C# Code: public struct...
9
by: James Wong | last post by:
Hi, I use the RichTextBox in my program. It will use different language in this RichTextBox (chinese and english characters), and it set the "DualFont" and use different fonts. By the way, how...
0
by: Robert | last post by:
Hi there, I have a dialog with a "RichTextBox" that's anchored on all 4 sides of the dialog. I now want to resize this control in my "OnLoad()" handler so that it reflects the size of its text....
1
by: bmerlover | last post by:
I'm having trouble reading quotations inside the richTextBox when a file is opened on to it. I've tried a couple different methods, most of them didn't compile. I came across one that does compile...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.