Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP60- SelStart and SelLength
Message
 
 
To
27/06/2000 10:49:15
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00385038
Message ID:
00385103
Views:
14
After the code to select the text, issue a DODEFAULT in the GotFocus. This will cause the first character to be highlighted.
With THIS
   .SelStart = 0
   .SelLength = 1
Endwith
DODEFAULT()
Of course this does nothing if the user clicks in the editbox (highlighting the first characetr) and then clicks somewhere else in the editbox. The GotFocus has already fired and will not fire again until the editbox has LostFocus.

HTH.

>Any suggestions on how do I select position 1 of a textbox using the keyboard AND the mouse?
>
>
>>That's actually correct behaviour - using SelLength simulates the mouse selection so using the mouse to enter the field will override this.
>>
>>>It doesn't work if you have something typed in the textbox and you use your mouse. The cursor remains where you clicked.
>>>
>>>
>>>>I've just tested and it works. This.SelStart=0 and This.SelLength=1 will select the first character of the text.
>>>>
>>>>>Anybody in here know how to use these two properties (SelStart and SelLength) to select position 1 on a textbox?
>>>>>
>>>>>I have issue a simple THIS.SELSTART = 0 in the GOTFOCUS event of the text box but this doesn't work.
>>>>>
>>>>>Thank you in advance.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Reply
Map
View

Click here to load this message in the networking platform