|
-
Sep 27th, 2006, 11:59 PM
#1
Thread Starter
New Member
Current cursor position in a Rich Text Box
hi all,
I have a problem to solve. I need the current cursor position of the Rich Text Box. If I use the RTb.SelStart, I am getting position of the cursor in Text content. But I want the position in RTF Content. Is there any way to get this ? Kindly help me !!
Regards,
Reshmi
-
Sep 28th, 2006, 12:21 AM
#2
Lively Member
Re: Current cursor position in a Rich Text Box
MsgBox RichText1.SelStart
SelStart property returns cursor position
-
Sep 28th, 2006, 12:26 AM
#3
Lively Member
Re: Current cursor position in a Rich Text Box
-
Sep 28th, 2006, 12:45 AM
#4
Re: Current cursor position in a Rich Text Box
Hi Reshmi ! Welcome to the forums ! 
Unfortunetly there is no straight way to get current cursor position from TextRTF. here is my idea. I hope it will give you some better ideas.
-
Sep 28th, 2006, 12:51 AM
#5
Addicted Member
Re: Current cursor position in a Rich Text Box
VB Code:
'in form
Private Sub Timer1_Timer()
Dim PT As POINTAPI
GetCaretPos PT
Me.Caption = "X: " & PT.X & " Y: " & PT.Y
End Sub
'in module
Public Declare Function GetCaretPos Lib "user32" (lpPoint As POINTAPI) As Long
Type POINTAPI
X As Long
Y As Long
End Type
Public POINTAPI As POINTAPI
P.S. Sorry for my poor English...
-
Sep 28th, 2006, 12:57 AM
#6
Re: Current cursor position in a Rich Text Box
...but that doesn't give you the insertion point in TextRTF. (Like SelStart is for .Text)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|