VFP中怎样为MSFlexGrid控件加上鼠标滚轮功能
MSFlexGrid不响应滚轮,怎样给它加上?最好是当鼠标在控件范围内时响应,离开后就不响应,先谢谢了
[解决办法]
BindEvent(_Screen, "MouseWheel", ThisForm, "FlxGdMouseWheeel")
ThisForm.FlxGdMouseWheeel:
LPARAMETERS nDirection, nShift, nXCoord, nYCoord
Local loArray[1]
If AMouseObj(m.loArray) > 0 ;
And loArray[1,1] = ThisForm.FlxGd
Do Case
Case m.nDirection = -120
ThisForm.FlxGd.TopRow = ThisForm.FlxGd.TopRow + 1
Case m.nDirection = 120
ThisForm.FlxGd.TopRow = Max(ThisForm.FlxGd.FixedRows, ThisForm.FlxGd.TopRow - 1)
EndCase
EndIf