0 Replies - 2131 Views - Last Post: 13 August 2012 - 07:27 AM Rate Topic: -----

#1 MiguelRosso  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 31-July 12

Hilight Text in VisualBasic 2010 in a RichTextbox

Posted 13 August 2012 - 07:27 AM

Hi! I'm making a code editor, and I want to know how to hilight a string (for example, "if"), andchange it's color.

I've got this code running in the RichTextBox control:
        If RichTextBox1.Text.Contains("if") Then
            RichTextBox1.Select(RichTextBox1.Find("print"), 5)
            RichTextBox1.SelectionColor = Color.Blue
            RichTextBox1.DeselectAll()


It changes the color of if, but italways keeps selecting it, and taking the cursor to the first index of the richtextbox. Any idea of how to fix this or do what I want to do?

Is This A Good Question/Topic? 0
  • +

Page 1 of 1