Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Strange Characters
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00101034
Message ID:
00101155
Vues:
18
Bob,

When you press a key several things happen. If you have the KeyPreview property set to .t., which enables the Form's KeyPress event, the Form's KeyPress Event Fires with the key you pressed. Then, the control's KeyPress Event Fires with that keystroke as well. NoDefault tells a method not to do what it's supposed to do. So, a NoDefault in a KeyPress event basically flushes that keystroke out of the buffer and let's you do whatever you want to do. Please note that these are not the only methods that fire upon a Keypress and there mey be other methods that fire between these methods. But these are the only ones were concerned with for this situation. NoDefault can be used in any method in which you don't want the default action to take place.

HTH

>Thank you it works Great! I gotta ask thou, Why?? I have only
>used the NODEFAULT in the Methods (Like in Refresh etc...)
>
>Thanks Again!
>
>>Bob,
>>
>>In the KeyPress of the Form, I'm assuming you have something like this:
>>
>>If nKeyCode = -5 && F6
>> This.txtBox.SetFocus()
>>EndIf
>>
>>This code would give the results you describe. Adding a NoDefault inside the if statement will throw the keystroke away so nothing gets passed to the txtBox. It would then look like this:
>>
>>If nKeyCode = -5 && F6
>> This.txtBox.SetFocus()
>> NoDefault
>>EndIf
>>
>>HTH
>>
_________________________________
There are 2 types of people in the world:
    Those who need closure
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform