hello all
I wanted to know, how to change the color of certain words in a rich text-box when a the user finishes to type the word (as in the VB editot where words like "end sub" are colored)
pleeease help
Meir
Printable View
hello all
I wanted to know, how to change the color of certain words in a rich text-box when a the user finishes to type the word (as in the VB editot where words like "end sub" are colored)
pleeease help
Meir
You'll have to write code to find the words who's color you want to change, set the selStart and selLength properties so that this text is selected and then use the SelColor property... similar to...
private Sub Test()
RichTextBox1.SelStart = 1
RichTextBox1.SelLength = 10
RichTextBox1.SelColor = vbRed
end sub
Trouble with this is that it highlights the word and if you immediately set the the sellength back to zero it will flicker.
Is there a more direct method, like using SendMessage(..) based on the current cursor location in the Richtextbox, that does not involve selecting the word ?