How can I retrieve / set the current position of the cursor in the textbox (as with .selstart)?
Thanks,
Bjoern
Position of the cursor
Re: Position of the cursor
Have a look at the GetSelection() method.
Crunching for Fab36_Folding-Division at Folding@Home. Join Fab36/Fab30! - Folding@Home and BOINC
Boycott DRM! Boycott HDCP!
Boycott DRM! Boycott HDCP!
-
- Cadet
- Posts: 9
- Joined: 12 Nov 2008, 10:26
Re: Position of the cursor
Thank you for the fast response.
I'm stuck here. How do i identify the Position of the "selectionStart"?
I'm stuck here. How do i identify the Position of the "selectionStart"?
Re: Position of the cursor
Code: Select all
Dim selStart As Long
TextBox1.GetSelection selStart
' now selStart holds the cursor's position
Crunching for Fab36_Folding-Division at Folding@Home. Join Fab36/Fab30! - Folding@Home and BOINC
Boycott DRM! Boycott HDCP!
Boycott DRM! Boycott HDCP!
-
- Cadet
- Posts: 9
- Joined: 12 Nov 2008, 10:26
Re: Position of the cursor
Thank you very much.
One last question: How can i set the Position afterwards to "selstart+1"? .setselection(selstart,selstart+1)?
One last question: How can i set the Position afterwards to "selstart+1"? .setselection(selstart,selstart+1)?
Re: Position of the cursor
If you just want to change the cursor's position to one character ahead, use
If you want to select the first character after the cursor's position, use
Code: Select all
SetSelection selStart + 1, selStart + 1
Code: Select all
SetSelection selStart, selStart + 1
Crunching for Fab36_Folding-Division at Folding@Home. Join Fab36/Fab30! - Folding@Home and BOINC
Boycott DRM! Boycott HDCP!
Boycott DRM! Boycott HDCP!
-
- Cadet
- Posts: 9
- Joined: 12 Nov 2008, 10:26
Re: Position of the cursor
Thank you very much!
Everything is working just fine!
Everything is working just fine!