Hi experts, I have this code but this is on click event button to underline the last word. but this is in click event using button. How can i convert this on keydown event with
If e.KeyCode = Keys.Space Then
End If
Dim count As String = RichTextBox1.Text
Dim LastWord As String = count.Split(" ").Last()
Dim index As Integer = RichTextBox1.Find(LastWord, 0, RichTextBoxFinds.WholeWord)
If index <> -1 Then
RichTextBox1.SelectionStart = index
RichTextBox1.SelectionLength = LastWord.Length
RichTextBox1.SelectionFont = New Font("Courier New", 15, FontStyle.Underline)
End If
Thanks.
|