Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub Write_code_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Write_code.TextChanged
- Dim strWord As String
- Dim lPos As Long
- strWord = "read"
- lPos = InStr(1, Write_code.Text, strWord, vbTextCompare)
- If lPos > 0 Then
- With Write_code
- .SelectionStart = lPos - 1
- .SelectionLength = Len(strWord)
- .SelectionColor = Color.Green
- .SelectionStart = Len(Write_code.Text)
- .SelectionLength = 0
- .SelectionColor = Color.Blue
- End With
- End If
- End Sub
- Private Sub Write_code_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Write_code.TextChanged
- Dim strWord As String
- Dim lPos As Long
- strWord = "read"
- lPos = InStr(1, Write_code.Text, strWord, vbTextCompare)
- If lPos > 0 Then
- Dim originalPosition As Long = Write_code.SelectionStart
- With Write_code
- .SelectionStart = lPos - 1
- .SelectionLength = Len(strWord)
- .SelectionColor = Color.Green
- .SelectionStart = Len(Write_code.Text) ' Or maybe put it here
- .SelectionLength = 0
- .SelectionColor = Color.Blue
- End With
- Write_code.SelectionStart = originalPosition
- End If
- End Sub
Add Comment
Please, Sign In to add comment