Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Setfocus problem
Message
De
12/04/2007 03:19:18
Yim Ming Sun Derek
Spacious Design Consultant
Hong Kong, Hong Kong
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Setfocus problem
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01214849
Message ID:
01214849
Vues:
51
Hi,
I want to control user to enter client code in a editbox and not allow enter a blank client code, if user enter a blank field, an warning message will display and setfocus to the editbox, I put the checking code in the Lostfocus event of the editbox, the code as follow:-
SET EXACT ON 
IF SEEK(ALLTRIM(thisform.txtCusno.Value),"CUSMAS")
   thisform.txtCusname.Value = cusmas->cusname
ELSE
	IF EMPTY(thisform.txtCusno.Value)
		MESSAGEBOX("You must enter client code!",48,"Warning")
	ELSE
		MESSAGEBOX("Client code not exist!",48,"Warning")
	ENDIF
   	thisform.txtCusname.Value = " "
	thisform.txtCusno.SetFocus()
ENDIF
When user press TAB to bypass the input, I find that thisform.txtCusno.SetFocus() does not work. I try to put this checking into the VALID event, but the VALID event does not allow the setfocus statement.
How could I do? please suggest.

Thanks

Derek Yim
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform