问题描述
1.我在mainform的FormMouseWheel的事件里边写了相应鼠标滚轮的事件。然后刚进系统,鼠标滚动,滚动条也能正常滚动。
procedure TMainForm.FormMouseWheel(Sender: TObject; Shift: TShiftState;
WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
begin
・・・
if WheelDelta < 0 then
sbxts200001.perform(WM_VSCROLL, SB_LINEDOWN, 0)
else
sbxts200001.perform(WM_VSCROLL, SB_LINEUP, 0)
・・・
2.但进入stringgrid编辑东西后,鼠标滚动,貌似是响应了stringgrid的滚动条,之后就无法让scrollbox相应鼠标滚动了。
3.好像问题点在于:
stringgrid编辑之前,鼠标针对的对象是form
stringgrid编辑之后,鼠标滚动的对象就变成了stringgrid了。
但
我在stringgrid的onexit事件中写了Form1.SetFocus;
结果还是不对
4.问下各位大侠,有什么办法,在编译stringgrid之后,重新让scrollbox相应鼠标滚动呢??
if StringGrid.RowCount > StringGrid.VisibleRowCount then
StringGrid.TopRow := StringGrid.RowCount - StringGrid.VisibleRowCount;
StringGrid1.Row := StringGrid.RowCount - 1;