Custom Text Box

Hi all
I am looking for a way to format Text in a TextArea which allows it colour code it for programming like it is with Xojo. So for example when I type Dim it turns blue.

Anyone know how/where I can find something like that ?

thanks

Chris

[quote=87556:@Chris Timm]I am looking for a way to format Text in a TextArea which allows it colour code it for programming like it is with Xojo. So for example when I type Dim it turns blue.
Anyone know how/where I can find something like that ?[/quote]

I don’t know of anything ready made. But here is an example of method that turns blue all occurrences of a word in a TextArea. You can start with this to build a larger method that applies different color to different words.

Sub colorit(c as string) dim position as integer = 1 while instr(position, me.text,c) >0 position = instr(position, me.text,c) me.selstart = position-1 me.sellength = len(c) me.seltextcolor = &c0000FF position = position+len(c) wend End Sub

This method is used in a TextArea class, but you can use this with TextArea1.Text, TextArea1.selstart, TextArea1.SelLength and TextArea1.SelTextColor instead of Me.xxx.