Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Tip: Grids and MouseWheel
Message
From
15/12/2007 01:02:49
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Tip: Grids and MouseWheel
Miscellaneous
Thread ID:
01276073
Message ID:
01276073
Views:
138
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()
Reply
Map
View

Click here to load this message in the networking platform