Question
May 10, 2007 at 11:07 AM
mastergamer

How to do syntax highlighting with VB6

by mastergamer . Updated 19 years, 5 months ago

I am trying to make a code editor with VB6 for the language Lua.
I have opening and saving files done and working, but I cannot seem to get the syntax highlighting to work.
Meaning, I need to search for specific words, color them blue, and make them bold.

I have tried various ways with both normal Text Box’s and Rich Text boxes, but I cannot seem to figure out how to go about doing it.

I was using Text1.Find(“function”) to look for the word function in a rich text box, and that worked, but I could not figure out how to then recolor it and or bold it. There is a RTB.SelBold and RTB.SelColor option, but that will replace “function” with whatever I type (I am trying to do this in Text1_Change())

Anyone have any thoughts? Suggestions? Any help to be provided in general?

This discussion is locked

All Comments