Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How can i move the cursor to beginning of field
Message
From
11/03/2002 07:16:03
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00630692
Message ID:
00630876
Views:
19
Hi Jaime

>How can i have move the cursor to the beginning of a field automatically?

You need to control the SELSTART property of the textbox, as Vlad told you.

However, due to the quirks of VFP's sub classing and base class behavior I have found that the only truly reliable (in all situations and all levels of class hierarchy) way of handling this is to include the following code in the GotFocus() of your textbox class:
*** Explicitly call base class behavior
TextBox::GotFocus()
WITH This
  *** Set insertion point
  .SelStart = 0
  IF .SelectOnEntry
    *** Highlight contents
    .SelLength = 999
  ENDIF
ENDWITH
*** Suppress normal base class behavior
NODEFAULT
Notice that this also highlights the contents when the native 'SelectOnEntry' property is set. If you don't want it, remove the code.
----
Regards
Andy Kramek
Previous
Reply
Map
View

Click here to load this message in the networking platform