level 10
以下是我找的资料里面的写法,希望大家指正提议~
Dim CurrentFont As System.Drawing.Font = RichTextBox1.SelectionFont
Dim NewFontStyle As System.Drawing.FontStyle
NewFontStyle = FontStyle.Bold
RichTextBox1.SelectionFont = New Font(CurrentFont.FontFamily, CurrentFont.Size, NewFontStyle)
2016年11月06日 14点11分
1
level 10
还有,想问下大家伙一些小白问题,这个富文本框是不能打开*.txt文件吗? 我载入TXT文件就报错。
2016年11月06日 14点11分
2
level 11
以我目前的水平来看应该没了。因为Font类的Bold属性是ReadOnly,所以只能重新建一个进行设置。我不知道是否有更好的方法。
2016年11月16日 13点11分
6
终于有哥们来一起讨论了~我等到花儿都谢了。我也尝试过Bold…就是会有个只读的报错。也是学习VB的小白。
2016年11月16日 14点11分
我翻资料才找到上面用的方法
2016年11月16日 14点11分
反正ReadOnly是个麻烦事。
2016年11月16日 14点11分
回复 zbx14251 :是不是碰到只读都得New一下~?
2016年11月16日 16点11分