Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing parameter to form
Message
De
07/08/1999 11:36:37
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00250894
Message ID:
00251079
Vues:
10
Hi Jane

>I want to add a textbox for the user to type in a password. It's just 1 password that works for everyone. SO I want to hardcode the password into the form. How do I get the form to end after the user types in the correct password? If it's incorrect, I have a message and they keep trying until it's correct of they click on cancel. Do I put code to check for the password in the click or the valid of the textbox? When that textbox loses focus, I want the form to unload. I appreciate your help. I'm a novice who may never get past this stage.

Well, I think the best design in this case would be an OK and CANCEL button on your paswword form, where the OK button is only enabled when the current password is the correct one.

Anyway, you will probaly want the pass word to come from a property or a field instead of actually hard coding it:
*Lost Focus of TextBox
Thisform.OKButton.enabled=(alltrim(this.Value)==thisform.cPassword)
Or just:
if alltrim(this.Value)==thisform.cPassword
and then do what you want.

This way they will always have the option to retry or just cancel anyways. If you would rather enable the OKButton before the user exists the TextBox, use InterActive Exchange instead (with a DoDefault())
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform