'在form中放一个textBox两个labelConst EM_GETSEL = &HB0Const EM_LINEFROMCHAR = &HC9Const EM_LINEINDEX = &HBBPrivate Declare Function SendMessage Lib "user32" Alias "SendMessageA" _(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, _lParam As Any) As LongPublic Sub GetCaretPos(ByVal hwnd5 As Long, LineNo As Long, ColNo As Long)Dim i As Long, j As LongDim lParam As Long, wParam As LongDim k As Longi = SendMessage(hwnd5, EM_GETSEL, wParam, lParam)j = i / 2 ^ 16 '取得目前Caret所在前面有多少个byteLineNo = SendMessage(hwnd5...[ 查看全文 ]