VB Syntax Coloring

There are now quite a few code repository programs on the market, and they all implement syntax colouring. This gives the program the look and feel of Visual Basic, but with their own customised interface. This control works by having a list of words that need to be coloured, and then checks the text for an occurrences of this text. It also handles comments and underscores.

Screen Shot


This control requires the Microsoft RichTextBox control 6.0 although you could change the design to support an earlier version.


The download comes with a full demonstration project which shows you how to change the colours (using the ChooseColour dialog).

Download Zipped Project File 56k


  • rtb

    Posted by Legacy on 04/30/2003 12:00am

    Originally posted by: Sam

    Excellent example.

  • Oracle Syntax colouring inVB6

    Posted by Legacy on 03/11/2003 12:00am

    Originally posted by: arul

    hello sir,

    i am student.
    i want to highlight the Oracle syntax through VB6.
    So please send me the code as soon as possibles.

    thank you.

    yours truly,

  • K�nnte besser sein.!

    Posted by Legacy on 01/04/2003 12:00am

    Originally posted by: Sinan Tuzcu

    Sehr gut aber k�nnte besser sein.

  • Thanks

    Posted by Legacy on 12/29/2002 12:00am

    Originally posted by: G�kşah TAŞY�REK

    good idea

  • yes I your give me the rouargh

    Posted by Legacy on 09/09/2001 12:00am

    Originally posted by: pekeo

    yes very good messire

  • Thank you soooooo much!!!!!!111

    Posted by Legacy on 09/07/2001 12:00am

    Originally posted by: Ice6200

    You are awesome. This gave me an idea for my own highlighter thing. Thanks a lot!!!!!

  • Needed .DLL?

    Posted by Legacy on 01/10/2000 12:00am

    Originally posted by: Julian

    is there any special .DLL file, needed by this .OCX?

  • i love u

    Posted by Legacy on 10/02/1999 12:00am

    Originally posted by: Rohan

    really cool app. , thnx a lot for it

  • Highlighting text by changing background color

    Posted by Legacy on 06/20/1999 12:00am

    Originally posted by: Jake

    None of the highlighting code I've so far seen produces a highlight like Word 97 generates, that is, the background behind the text changes color to yellow. Has anyone succeeded in doing this, either in a text box or rich text box?

    If I create a Word 97 document, type a few words, then highlight one word and save the document in rtf format, the resultant rtf contains "\highlight7" in front of the word. However, this is ignored by the rtf formatter in the rich text box. Any ideas why? Are there different levels of rtf?



Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Enterprises are increasingly looking to platform as a service (PaaS) to lower their costs and speed their time to market for new applications. Developing, deploying, and managing applications in the cloud eliminates the time and expense of managing a physical infrastructure to support them. PaaS offerings must deliver additional long-term benefits, such as a lower total cost of ownership (TCO), rapid scalability, and ease of integration, all while providing robust security and availability. This report …

  • Moving from an on-premises environment to Office 365 does not remove the need to plan for disruptions or reduce the business risk requirements for protecting email services. If anything, some risks increase with a move to the cloud. Read how to ease the transition every business faces if considering or already migrating to cloud email. This white paper discusses: Setting expectations when migrating to Office 365 Understanding the implications of relying solely on Exchange Online security Necessary archiving …

Most Popular Programming Stories

More for Developers

RSS Feeds

Thanks for your registration, follow us on our social networks to keep up-to-date