Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How can i move the cursor to beginning of field
Message
De
11/03/2002 07:16:03
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00630692
Message ID:
00630876
Vues:
20
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform