Hello ! (and happy new year )
Is there a way to fire grid scrolling when mouse cursor approaches the top/bottom (depending on the mouse direction) of the grid while dragging ?
Thx.
Posted 03 January 2023 - 12:11 AM
Hello ! (and happy new year )
Is there a way to fire grid scrolling when mouse cursor approaches the top/bottom (depending on the mouse direction) of the grid while dragging ?
Thx.
Posted 04 January 2023 - 11:58 AM
Finally; I did it
1) global var to store Y initial value of mouse cursor
PrevMouseY:Integer;
2) set this var in the MouseDown event
PrevMouseY:=Y;
3) Add 2 small imbeded functions in DragOver event
function MouseMoveUP(y:Integer):Boolean; begin if Y<PrevMouseY then begin PrevMouseY:=Y; Result:=True; end else Result:=False; end; function MouseMoveDown(Y:Integer):Boolean; begin if Y>PrevMouseY then begin PrevMouseY:=Y; Result:=True; end else Result:=False; end;
4) Add this code in DragOver event
i:=(GridRequete.Height - GridRequete.HeaderSize) div 4; if MouseMoveUP(Y) and (Y < i) then GridRequete.VertScrollBar.Prior; if MouseMoveDown(Y) and (Y > 3*i) then GridRequete.VertScrollBar.Next;
the and (Y condition prevent immediate scroll
0 members, 1 guests, 0 anonymous users