Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select on Enter quit working
Message
De
28/06/2002 08:56:23
 
 
À
28/06/2002 07:07:15
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00672944
Message ID:
00673227
Vues:
22
Hi Hilmar.

Now I remember that when I click with the mouse, the field isn't selected either - only when I enter with TAB. It seems to me you have or had custom code that provides this functionality (perhaps as part of a third-party framework), and now this custom code isn't available any more. Check if you didn't break inheritance. The most common way to break inheritance is to write custom code in some method and forget the DoDefault().

From Chapter 4 of 1001 Things You Wanted to Know About VFP:

For example, to make a text box select its entire contents when it receives focus, you might just set the SelectOnEntry property to .T. (or set the Format property to “K”). In fact either of these will only work when the control receives focus by movement from another control and will not do anything when the user mouse-clicks into the text box. Fortunately, it is easy enough to give all text boxes this basic functionality by putting this code in the GotFocus method of your standard text box class:

TextBox::GetFocus()
.SelStart = 0
.SelLength = 999
NODEFAULT

Since this is a root class, you may wonder why we use the line Textbox::GotFocus() instead of just issuing a DODEFAULT(). The reason is that in Visual FoxPro 5.0a, there was a bug in DODEFAULT() that caused the Visual FoxPro base class behavior to be executed after executing the code in the parent class. This meant that, unless you had a NODEFAULT at the end of the method in the sub class, the base class code would be executed twice. (This is because, by default, Visual FoxPro runs any custom code that you have put into a method and then runs the base class code afterward.) In Visual FoxPro 6.0, DODEFAULT() no longer runs the base class code unless, of course, the subclass is directly descended from Visual FoxPro's base class. So in Visual FoxPro 6.0, base class behavior is guaranteed to execute when calling it directly with the scope resolution operator.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform