如何在C#中运行时调整富文本框的大小? [英] How do I resize rich text box while running in C#?

查看:432
本文介绍了如何在C#中运行时调整富文本框的大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在C#中运行时调整富文本框的大小?

How to resize the rich text box while running in C#?

推荐答案

高度宽度 RichTextBox控件的属性可以设置为所需的值,比如在Button控件的Click事件中。

The Height and Width properties of RichTextBox control can be set to the required values, say in the Click event of a Button control.
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);



但是如果RichTextBox的Dock属性设置为None以外的值,它将无效。


However it will not work if the Dock property of the RichTextBox is set to a value other than None.






您可以设置文本框控件的宽度和高度。



textBox1.Size = new Size(100,100); // Arqs是高度和宽度。
Hi

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

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


这篇关于如何在C#中运行时调整富文本框的大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆