Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Lostfocus by mouse click
Message
De
16/03/2016 14:40:33
 
 
À
15/03/2016 22:22:27
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01633146
Message ID:
01633188
Vues:
65
the getfocus event appears on a textbox when the user (or code) select this conrol(textbox receives the focus).
the getfocus event is called by user action, such as a mouse click, or when the SetFocus method is
called in code.

the lostfocus event appears on a textbox when the user selects another control(click,TAB or setfocus code).
if there is one textbox on a form it have always the focus (cannot lostfocus).the form have not setfocus event.

clicking on the form does anything with lostFocus because it appears only if another control is selected by the code or by user.Test this code(if the form receive a click it redirect the focus on another control ,then the textbox losfocus(messagebox)
publi yform
yform=newObject("asup")
yform.show(1)
*
DEFINE CLASS asup AS form
	Top = 37
	Left = 267
	Caption = "Form1"
	Name = "Form1"

	ADD OBJECT text1 AS textbox WITH ;
		Height = 25, ;
		Left = 120, ;
		Top = 12, ;
		Width = 121, ;
		Name = "Text1"

	ADD OBJECT command1 AS commandbutton WITH ;
		Top = 144, ;
		Left = 216, ;
		Height = 49, ;
		Width = 133, ;
		Caption = "Command1", ;
		Name = "Command1"

	ADD OBJECT list1 AS listbox WITH ;
		Height = 109, ;
		Left = 12, ;
		Top = 96, ;
		Width = 169, ;
		Name = "List1"

	PROCEDURE my
		messagebox("click")
		thisform.command1.setfocus
	ENDPROC

	PROCEDURE Init
		bindevent(thisform,"click",thisform,"my")
	ENDPROC

	PROCEDURE text1.GotFocus
		messagebox("textbox have the focus")
	ENDPROC

	PROCEDURE text1.LostFocus
		messagebox("textbox lost the focus")
	ENDPROC
ENDDEFINE
*-- EndDefine: asup
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform