I have a rich text box in which I need to colour certain strings with certain colours. Much like the way the VB IDE colours VB keywords etc.
I've done this by just stepping through all the text in the text box, checking for certain strings and once found using [color].SelText[/color] and [color].SelLen[/color] to color that chunk of text.
However, this takes a long time and needs the rich text box to be visibly scrolled through.
In the VB IDE it happens instantly when you copy un formatted text into the code window. How does it do it so efficiently? Would I have to do the formatting inside a string in memory and maybe add rich text formatting information? Or is there an easier way?
Cheers
elziko
I've done this by just stepping through all the text in the text box, checking for certain strings and once found using [color].SelText[/color] and [color].SelLen[/color] to color that chunk of text.
However, this takes a long time and needs the rich text box to be visibly scrolled through.
In the VB IDE it happens instantly when you copy un formatted text into the code window. How does it do it so efficiently? Would I have to do the formatting inside a string in memory and maybe add rich text formatting information? Or is there an easier way?
Cheers
elziko