首页 相关文章 如何实现在TextBox中如何得知Caret所在位置

如何实现在TextBox中如何得知Caret所在位置

  

'在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...[ 查看全文 ]

2016-02-19 标签:

如何实现在TextBox中如何得知Caret所在位置的相关文章

手机页面
收藏网站 回到头部