-
September 6th, 2002, 11:03 AM
#1
Finding where the Cursor is ...
Hello Gurus,
I have a simple basic problem.
Inside a textbox, there will be some text, and when the cursor is moved within the textbox, when it is in the begining or in the end, I want to move the cursor to another text box
We need to know where exactly the cursor is within a textbox either in the begining or in end
Any help is greatly apprecited.
Thankx in advance.
Regards,
Shivakumar G.M.
-
September 6th, 2002, 11:06 AM
#2
cursor
Use GetCursorPos and SetCursorPos APIs
for APIs infos,
http://www.allapi.net
http://www.vbapi.com
And use the TextBox mouse_move event
JeffB
-
September 6th, 2002, 11:25 AM
#3
tried in site allapi.net
but there are
No functions found that begin with the letter G
-
September 6th, 2002, 12:08 PM
#4
Try this and just make adjustments.
Code:
Private Sub Text1_Change()
If Text1.SelStart = Text1.MaxLength Then
SendKeys "{Tab}"
End If
End Sub
Private Sub Text1_KeyUp(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyLeft Then
If Text1.SelStart = 0 Then
SendKeys "+{Tab}"
End If
ElseIf KeyCode = vbKeyRight Then
If Text1.SelStart = Text1.MaxLength Or Text1.SelStart = Len(Text1.Text) Then
SendKeys "{Tab}"
End If
End If
End Sub
Marketing our skills - please participate in the survey and share your insights
-
-
September 6th, 2002, 12:11 PM
#5
oops
Ooops, sorry, I thought you were talking of MouseCursor, what you need is the SelStart of a TextBox, aio is right about sending Tab key, but you can also use textbox2.SetFocus, and then set the SelStart of that textbox
JeffB
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
|