更改richtextbox中的文本大小 [英] change the text size in a richtextbox

查看:108
本文介绍了更改richtextbox中的文本大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿伙计们这里有一点问题

我试图在一个丰富的盒子里改变字体或文字大小

i得到一个组合框中列出的尺寸(尺寸是10,12,14,16,20)

我想要做的是当你选择一个尺寸我希望richtextbox尺寸的文字根据组合框中的选定尺寸改变/>


i试过这段代码

richTextBox1.SelectionFont = toolStripComboBox1.Size;

richTextBox1.Focus();

解决方案

尝试:

 richTextBox1.SelectionFont =  new 字体(richTextBox1.SelectionFont.FontFamily, 12  .0F); 

其中12.0F是您想要的字体大小。 (ComboBox.Size是一个结构,它表示组合框的大小,而不是用户选择的值)


http://msdn.microsoft.com/en-us/library/yh8963yx.aspx [ ^ ]

http://www.java2s.com/Code/CSharp/GUI-Windows-Form/SetFontsizefamilyforaRichTextBox.htm [ ^ ]


hey guys am having a little problem here
am trying to change font or text size in a rich box
i got the size listed in a combobox (the sizes are 10,12,14,16,20)
what i want to do is when you select a size i want the text in the richtextbox size to be change according to the selected size in the combobox

i tried this code
richTextBox1.SelectionFont = toolStripComboBox1.Size;
richTextBox1.Focus();

解决方案

Try:

richTextBox1.SelectionFont = new Font(richTextBox1.SelectionFont.FontFamily, 12.0F);

Where "12.0F" is the font size you want. (ComboBox.Size is a structure, and which says how big the combobox is, not what value the user selected)


http://msdn.microsoft.com/en-us/library/yh8963yx.aspx[^]
http://www.java2s.com/Code/CSharp/GUI-Windows-Form/SetFontsizefamilyforaRichTextBox.htm[^]


这篇关于更改richtextbox中的文本大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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