How to highlight text in richtextbox? | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
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.

19th Apr 2018, 1:05 PM
Byte
Byte - avatar
1 Respuesta
+ 1
int blockStart = 1; // where to start int blockLength = 5; // hello is 5 letters richTextBox1.SelectionStart = blockStart; richTextBox1.SelectionLength = blockLength; richTextBox1.SelectionBackColor = Color.Blue;
21st Apr 2018, 10:34 AM
kukogho gabriel
kukogho gabriel - avatar