Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to make a grid double-clic function works ?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00774429
Message ID:
00774512
Vues:
16
>I would like to open a form when the user double-clic on a grid line.
>I wonder how we can do it in a single grid method ?
>It is in vfp 8.

This code seems to work for me.
DEFINE CLASS form1 AS form

	DoCreate = .T.
	Caption = "Form1"
	Name = "Form1"

	ADD OBJECT grid1 AS grid WITH ;
		ColumnCount = -1, ;
		Height = 217, ;
		Left = 12, ;
		RecordSource = "labels", ;
		Top = 0, ;
		Width = 301, ;
		Name = "Grid1"

	PROCEDURE grddblclick
		WAIT WINDOW TRANSFORM(RECNO())
	ENDPROC

	PROCEDURE Init
		FOR EACH loColumn IN ThisForm.grid1.Columns
			FOR EACH loControl IN loColumn.Controls
				IF UPPER(loControl.BaseClass) = "TEXTBOX"
					BINDEVENT(loControl, "DblClick", ThisForm, "grdDblClick")
				ENDIF
			ENDFOR 
		ENDFOR
	ENDPROC
ENDDEFINE
My blog
My consulting page
My home page

Member of the Trim Your Auto-Quote Campaign!
What's another word for thesaurus?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform