Detecting cursor position in a text box...

  • Thread starter Jim Burke in Novi
  • Start date
J

Jim Burke in Novi

Is there a simple way to determine where the cursor is in a text box after
someone clicks on it (e.g. in position 9 after the 8th character)? Haven't
been able to find this anywhere. I know how to use SelStart to SET the
position, but not how to GET the position.

Jim Burke
 
J

John Spencer

Unless I am mistaken, just use SelStart without assigning a value.

Dim lngPosition as Long

lngPosition = Me.TextboxControl.SelStart
MsgBox "In position " & lngPosition
 
J

Jim Burke in Novi

Thanks. That's simple enough!

John Spencer said:
Unless I am mistaken, just use SelStart without assigning a value.

Dim lngPosition as Long

lngPosition = Me.TextboxControl.SelStart
MsgBox "In position " & lngPosition
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top