如何使RichTextBox中的选定文本粗体,斜体,下划线,将其颜色更改为红色,将字体更改为“Lucida Sans Unicode”,并将文本大小设置为18pt。格式化富文本框中的文本
0
A
回答
0
试试这个
this.richTextBox1.SelectionFont = new Font("Lucida Sans Unicode", 18,
FontStyle.Bold | FontStyle.Italic | FontStyle.Underline);
this.richTextBox1.SelectionColor = Color.Red;
我没试过,这里是VB.Net代码
Me.richTextBox1.SelectionFont = New Font("Lucida Sans Unicode", 18, _
FontStyle.Bold Or FontStyle.Italic Or FontStyle.Underline)
Me.richTextBox1.SelectionColor = Color.Red
的
+0
“this”不能使用...........错误`Overload分辨率失败,因为如果没有缩小转换,则无法调用可访问的“新建”: 'Public Sub New(familyName As String,emSize As Single,unit As System.Drawing.GraphicsUnit)':参数'unit'的参数从'String'变窄为'System.Drawing.GraphicsUnit'。 'Public Sub New(familyName As String,emSize As Single,style As System.Drawing.FontStyle)':参数匹配参数'style'从'String'变窄为'System.Drawing.FontStyle'。' – 2011-02-04 11:26:41
相关问题
- 1. 在C中格式化富文本框/文本文件#
- 2. 如何自动格式化粘贴到富文本框中的文本?
- 3. 格式添加富文本框
- 4. 我无法将格式化文本粘贴到富文本框中
- 5. C#富文本框样式
- 6. 文本框格式化
- 7. 文本框格式化
- 8. Xamarin.Forms中的富文本框
- 9. Android中的富文本框
- 10. 富文本框。 .NET 2.0内容格式化
- 11. 将富文本格式字符串复制为格式文本
- 12. Silverlight - 富文本框
- 13. 在cakephp中格式化文本框(使文本框变大)
- 14. 在facebook chatbot中响应文本的富文本格式
- 15. 从富文本格式的QLabel中获取纯文本
- 16. 使用RichEditBox格式化富文本格式
- 17. 启用富文本格式并继续格式化
- 18. 在富文本框中删除电子表格格式
- 19. 如何格式化数据绑定文本框中的文本?
- 20. 如何格式化文本框中的文本布局
- 21. 在文本框中格式化C#
- 22. DateTime?在文本框中格式化
- 23. jquery最小化富文本框插件
- 24. 如何格式化文本框风格
- 25. 如何在textarea中显示丰富的格式化文本
- 26. 首页上的富文本格式 - django
- 27. 跟踪富文本框文本?
- 28. 丰富的文本框
- 29. VS2010:格式化货币的文本框
- 30. 在文本悬停框中格式化文本
可能重复[WPF的RichTextBox:如何更改所选文本的字体(HTTP: //sackoverflow.com/questions/3496865/wpf-richtextbox-how-to-change-selected-text-font) – Heinzi 2011-02-04 11:15:20