Supponendo che la tua RichTextBox si chiami Rtb1:
codice:
Option Explicit
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Declare Function SendMessageReferenceParams Lib "user32" Alias "SendMessageA" _
(ByVal hwnd As Long, ByVal wMsg As Long, ByRef wParam As Long, ByRef lParam As Long) As Long
Private Const EM_GETLINECOUNT = &HBA: Private Const EM_LINEINDEX = &HBB
Private Const EM_LINELENGTH = &HC1: Private Const EM_GETSEL = &HB0
Private Const EM_LINEFROMCHAR = &HC9
Private Sub Command1_Click()
Dim start_pos As Long, end_pos As Long
Dim PosRow As Integer, PosCol As Integer
SendMessageReferenceParams Rtb1.hwnd, EM_GETSEL, start_pos, end_pos
PosRow = SendMessage(Rtb1.hwnd, EM_LINEFROMCHAR, start_pos, 0)
PosCol = start_pos - SendMessage(Rtb1.hwnd, EM_LINEINDEX, -1, 0)
End Sub
PosRow conterrà il valore della riga, PosCol quello della colonna (partendo da 0).
Ciauz
Chico
p.s. : il cursore lampeggiante si chiama 'caret'