Q
qczyy
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm_dbgrid.ApplicationEvents1Message(var Msg: tagMSG;
var Handled: Boolean);
begin
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;
end;
=====以上代码实现了在DBGRID中可用鼠标滑动轮,但在选定多条记录后滑动,选定的记录焦点全部丢失(用下拉条就不会丢失),该怎么解决呢?
var Handled: Boolean);
begin
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;
end;
=====以上代码实现了在DBGRID中可用鼠标滑动轮,但在选定多条记录后滑动,选定的记录焦点全部丢失(用下拉条就不会丢失),该怎么解决呢?