Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Textbox
Message
From
16/04/2000 06:09:27
 
 
To
16/04/2000 06:02:45
Liam O'Hagan
O'Hagan Programming Ltd
Ireland
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
00360078
Message ID:
00360108
Views:
12
Hi Liam.

>> I don't think there is a way to establish the current position in a text box or edit box but perhaps someone can tell me I'm wrong ? <<

OK. You're wrong ;-) Tetbox.SelStart is the current cursor position. If you have to save it, just add a custom property to your textbox called nLastPosition and initialize it to 0. Then, in the control's Valid, save .SelStart to .nLastPosition. In the GotFocus, just put something like this:
Textbox::GotFocus()
This.SelStart = This.nLastPosition
lnLen = LEN( TRANSORM( This.Value ) ) - This.SelStart
IF lnLen > 0
   This.SelLength = lnLen
ENDIF
NODEFAULT
This code is untested and off the top of my head, so you will need to test to see if it does what you require.

Marcia
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform