0
How to highlight text in richtextbox?
i need help,i need to highlight custom words in richtextbox (Visual Studio WinForms) like if in richtextbox printed "hello",hello word will be blue color,it says,if printed "hello all",only hello word be a blue color.
1 Antwort
+ 1
int blockStart = 1; // where to start
int blockLength = 5; // hello is 5 letters
richTextBox1.SelectionStart = blockStart; richTextBox1.SelectionLength = blockLength; richTextBox1.SelectionBackColor = Color.Blue;