CodeItBetter Programming Another VB Programming Blog

How to find out what column cursor is in RTF?

Posted on January 4, 2009
1
2
3
4
5
6
7
8
9
10
'Controls - How to find out what column cursor is in RTF?
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 Const EM_LINEINDEX = &HBB
 
Private Function GetColumn(rtfBox As RichTextBox) As Long
    Dim lngCharPos As Long
    lngCharPos = SendMessage(rtfBox.hwnd, EM_LINEINDEX, rtfBox.GetLineFromChar(rtfBox.SelStart), 0&)
    GetColumn = rtfBox.SelStart - lngCharPos
End Function
Filed under: Controls Leave a comment
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


 

No trackbacks yet.