如何使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. 格式添加富文本框
- 2. 我無法將格式化文本粘貼到富文本框中
- 3. 文本框格式化
- 4. 文本框格式化
- 5. Xamarin.Forms中的富文本框
- 6. 富文本框。 .NET 2.0內容格式化
- 7. 將富文本格式字符串複製爲格式文本
- 8. 從富文本格式的QLabel中獲取純文本
- 9. 在facebook chatbot中響應文本的富文本格式
- 10. 啓用富文本格式並繼續格式化
- 11. 如何格式化數據綁定文本框中的文本?
- 12. 如何格式化文本框中的文本佈局
- 13. 在文本框中格式化C#
- 14. 如何格式化文本框風格
- 15. jquery最小化富文本框插件
- 16. 如何在textarea中顯示豐富的格式化文本
- 17. 跟蹤富文本框文本?
- 18. 在文本懸停框中格式化文本
- 19. 格式化文本
- 20. 格式化文本
- 21. 使用VBA格式化來自Mulitline文本框的文本
- 22. 格式化文本框內的部分文本
- 23. Flash文本框格式化差異
- 24. 格式化組合框文本C#
- 25. 格式化劍道數字文本框
- 26. 在多行文本框內格式化
- 27. 格式化文本框爲MM/YYYY
- 28. C#富文本框高亮
- 29. HTML Javascript富文本框(IDE)
- 30. 富文本框字符集
可能重複[WPF的RichTextBox:如何更改所選文本的字體(HTTP: //sackoverflow.com/questions/3496865/wpf-richtextbox-how-to-change-selected-text-font) – Heinzi 2011-02-04 11:15:20