哈哈,我来解决!;)是不是这个?!procedure TCustomDBGridEh.Scroll(Distance: Integer); var OldRect, NewRect, ClipRegion: TRect; RowHeight: Integer; VertSBVis: Boolean; begin if not HandleAllocated then Exit; OldRect := BoxRect(0, Row, ColCount - 1, Row); // modify by crm 20040302 修改列表更新 // if (FDataLink.ActiveRecord >= RowCount - TopDataOffset) // then UpdateRowCount; // 改为: UpdateRowCount;
// modify by crm本人在D6下调试通过,在万人使用半年后没问题!
这是我以前在网上找的资料。希望对你有所帮助。我没有试过。 如何在TDBGrid控件中正确的使用鼠标滚轮 (2004年1月30日) Mouse wheel behaves strangely with dbgrids - this code handler will correct this behavior. 鼠标中轮在TDBGrid控件中总是工作的很奇怪-这段代码将能改正这个错误。Just drop a TApplication component on a form 你只要将一个TApplication 控件放到窗体上~~~~~~~~~~~~~~~~~~~~~~~~~ procedure Application1.OnMessage (var Msg: TMsg; var Handled: Boolean) ; var i: SmallInt; begin if Msg.message = WM_MOUSEWHEEL then begin Msg.message := WM_KEYDOWN; Msg.lParam := 0; i := HiWord(Msg.wParam) ; if i > 0 then Msg.wParam := VK_UP else Msg.wParam := VK_DOWN;Handled := False; end; end;
var
OldRect, NewRect, ClipRegion: TRect;
RowHeight: Integer;
VertSBVis: Boolean;
begin
if not HandleAllocated then Exit;
OldRect := BoxRect(0, Row, ColCount - 1, Row);
// modify by crm 20040302 修改列表更新
// if (FDataLink.ActiveRecord >= RowCount - TopDataOffset)
// then UpdateRowCount;
// 改为:
UpdateRowCount;
// modify by crm本人在D6下调试通过,在万人使用半年后没问题!
如何在TDBGrid控件中正确的使用鼠标滚轮 (2004年1月30日)
Mouse wheel behaves strangely with dbgrids - this code handler will correct this behavior.
鼠标中轮在TDBGrid控件中总是工作的很奇怪-这段代码将能改正这个错误。Just drop a TApplication component on a form
你只要将一个TApplication 控件放到窗体上~~~~~~~~~~~~~~~~~~~~~~~~~
procedure Application1.OnMessage
(var Msg: TMsg; var Handled: Boolean) ;
var
i: SmallInt;
begin
if Msg.message = WM_MOUSEWHEEL then
begin
Msg.message := WM_KEYDOWN;
Msg.lParam := 0;
i := HiWord(Msg.wParam) ;
if i > 0 then
Msg.wParam := VK_UP
else
Msg.wParam := VK_DOWN;Handled := False;
end;
end;
Additional -> TApplicationEvents