
Originally Posted by
Seraphino
I am making a coding assistant program, and I want to make it so that after a user presses the space bar, if the last word typed is one that the program recognizes, it will turn it to the color specified.
Basically, I want to do syntax highlighting. If there is any easier way than this please tell me, or else post some code.
Hi,
I think you can use the ColorDialog for that, here's an exa^mple with a RichTextBox and a Button.
VB Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If ColorDialog1.ShowDialog <> Windows.Forms.DialogResult.Cancel Then
rtxtEditor.ForeColor = ColorDialog1.Color
End If
End Sub
Hope it helps,
sparrow1