5,392
社区成员
发帖
与我相关
我的任务
分享
IF (DBGrid1.Focused) And (Msg.message = WM_MOUSEWHEEL) then
Begin
IF Msg.wParam > 0 then
SendMessage(DBGrid1.Handle, WM_KEYDOWN, VK_UP, 0)
Else
SendMessage(DBGrid1.Handle, WM_KEYDOWN, VK_DOWN, 0);
Handled := True;
End;
var
aComtrol:TComponent;
begin
aComtrol:=TComponent(Screen.ActiveControl.Name);
IF (aComtrolClass is TDBGrid) Then
Begin
IF (TDBGrid(aComtrolClass).Focused) And (Msg.message = WM_MOUSEWHEEL) then
Begin
IF Msg.wParam > 0 then
SendMessage(TForm(aComtrol).Handle, WM_KEYDOWN, VK_UP, 0)
Else
SendMessage(TForm(aComtrol).Handle, WM_KEYDOWN, VK_DOWN, 0);
Handled := True;
End;
End;
end;