Making 1 word in a textarea a different color than

BlitzPlus Forums/BlitzPlus Programming/Making 1 word in a textarea a different color than

code(Posted 2004) [#1]
How would I make one word in a text area a different color than the rest?


Kanati(Posted 2004) [#2]
I stand corrected.


xlsior(Posted 2004) [#3]
How would I make one word in a text area a different color than the rest?


FormatTextAreaText textarea,red,green,blue,flag,pos,len,units

You can send 'formatting' information to a textarea with that, and specify the location and length to apply it to...

so, if you want to make a single word a different color, you would have to write some mechanism to detect the word, find out the location of it (See TextAreaText to obtain the text itself, and TextAreaLine, TextAreaChar, TextAreaCursor to find the position).
Once you know where your word is, you can use FormatTextAreaText to change the color or style for [length of word] postitions, starting at the beginning of the word.