Is there a way to find out what line the cursor is on in a rich text box? I know you can get what the position is, but I want just the line.
Printable View
Is there a way to find out what line the cursor is on in a rich text box? I know you can get what the position is, but I want just the line.
You can use the GetLineFromChar function.
Code:Private Sub Command1_Click()
'Top/First line = 0
MsgBox RichTextBox1.GetLineFromChar(RichTextBox1.SelStart)
End Sub