RichTextBox改變單行字型顏色

2021-09-23 07:58:03 字數 405 閱讀 7222

做個記錄,使用richtextbox的時候,改變單行字型的顏色

在winform裡建立乙個靜態類,內容如下

public static class richtextboxextension

rtbox.selectionstart = rtbox.textlength;

rtbox.selectionlength = 0;

rtbox.selectioncolor = color;

rtbox.selectioncolor = rtbox.forecolor;

}}

其中有4個引數

插入richtextbox的name屬性

插入的文字內容

插入的文字顏色

簡單行為改變一生 steve chen

1 每天給自己乙個檢討的機會,一年就會有三百六十五次檢討機會,你的成功機率就多了365 2 失敗不是成功之母 檢討才是.3 最好的人才是免費的 4 成功就是簡單的事情重複做 5 業績不好的原因只有乙個 不認真 6 態度佔了成功的100 7 顧客買你的產品,是買你的態度和工作的精神 8 當你成為行業的...

RichTextBox的翻頁演算法

system.runtime.interopservices.dllimport user32.dll public static extern int sendmessage intptr hwnd,int wmsg,int wparam,int lparam private void paged...

相互關聯的RichTextbox

using system.windows.forms public class synchronizedscrollrichtextbox system.windows.forms.richtextbox public const int wm vscroll 0x115 public const ...