Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Tip: Grids and MouseWheel
Message
De
15/12/2007 01:02:49
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Tip: Grids and MouseWheel
Divers
Thread ID:
01276073
Message ID:
01276073
Vues:
135
Just thought I'd post this little trick I found, in case it helps anyone.
I like to use my mousewheel a lot (so do users), and it always bugged me that if the VFP grid didn't have focus, the mousewheel wouldn't work, requiring me to click into the grid first. This little bit of code in your grid base class MouseWheel() event will make all your grids be more wheel friendly... :)
LPARAMETERS nDirection, nShift, nXCoord, nYCoord

LOCAL m.ln1

* scroll grid if it doesn't have focus
IF TYPE("thisform.ActiveControl") = "O" AND thisform.ActiveControl <> this
	thisform.lockscreen= .t.
	FOR m.ln1= 1 TO 3
		this.DoScroll(IIF(m.nDirection < 0, 1, 0))
	ENDFOR 
	thisform.lockscreen= .f.
	NODEFAULT
ENDIF

RETURN DODEFAULT()
Répondre
Fil
Voir

Click here to load this message in the networking platform