Click here to Skip to main content
15,894,907 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
How to resize the rich text box while running in C#?
Posted

The Height and Width properties of RichTextBox control can be set to the required values, say in the Click event of a Button control.
C#
RichTextBox1.Width= 500; //Value in pixels
RichTextBox1.Height = 300; //Value in pixels.
//Or the Size property can be used
RichTextBox1.Size=new System.Drawing.Size(500,300);

However it will not work if the Dock property of the RichTextBox is set to a value other than None.
 
Share this answer
 
v2
Comments
Sergey Alexandrovich Kryukov 11-Apr-12 22:17pm    
The question of a lazy OP (or what else could it be?) is answered, a 5 :-)
--SA
VJ Reddy 11-Apr-12 22:27pm    
Thank you, SA.
Hi

You can set the width and height to the textbox control..

textBox1.Size = new Size(100, 100); //Arqs are height and width.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900