Musste ich erstmal ausprobieren.
So wird das Grid gescrollt, über dem sich die Maus befindet, wenn das Scrollrad betätigt wird.
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55:
| procedure TForm1.ApplicationEvents1Message(var Msg: tagMSG; var Handled: Boolean); var i: SmallInt; Maus : TPoint; PanelTop : integer; begin if Msg.message = WM_MOUSEWHEEL then begin Msg.message := WM_KEYDOWN; Msg.lParam := 0; i := HiWord(Msg.wParam) ; GetCursorPos(Maus);
paneltop := self.top + Panel_Kopf.Height + 27; if (maus.x > DBGrid1.left + self.left) and (maus.x < (DBGrid1.left + DBGrid1.Width + self.left)) and (maus.y > (PanelTop + DBGrid1.top)) and (maus.y < (paneltop + DBGrid1.top + DBGrid1.Height)) then begin if i > 0 then begin Table1.Prior; end else begin Table1.next; end; end;
if (maus.x > DBGrid2.left + self.left) and (maus.x < (DBGrid2.left + DBGrid2.Width + self.left)) and (maus.y > (PanelTop + DBGrid2.top)) and (maus.y < (paneltop + DBGrid2.top + DBGrid2.Height)) then begin if i > 0 then begin Tabel2.Prior; end else begin Table2.next; end; end; Handled := False; end; end; |