Getting the position of the cursor in a text field.
Posted: Thu Oct 15, 2009 3:45 pm
Sorry to ask, but im hitting a little brick wall with this one!
Is it possible to find the location of the cursor in a text box?
I just need it so I can return a user to the same cursor position after Ive run some other code that is causing the text box to lose its focus. When I focus back on the control it places the cursor at the end and not where it was, which is a little annoying for the user.
Id guess I need to use....
select after char tMyChar of field "myField"
to place the user where I want them, but how do I find out the value of tMyChar.
If its not possible, Ill try to figure out how to keep the focus on the control while executing the code, but the quick option for me at the moment would to simply log the position in a temporary variable, then pick it back up when the code is finished.
Thanks
Andy
Is it possible to find the location of the cursor in a text box?
I just need it so I can return a user to the same cursor position after Ive run some other code that is causing the text box to lose its focus. When I focus back on the control it places the cursor at the end and not where it was, which is a little annoying for the user.
Id guess I need to use....
select after char tMyChar of field "myField"
to place the user where I want them, but how do I find out the value of tMyChar.
If its not possible, Ill try to figure out how to keep the focus on the control while executing the code, but the quick option for me at the moment would to simply log the position in a temporary variable, then pick it back up when the code is finished.
Thanks
Andy