procedure TCustomGridEh.MoveCurrent(ACol, ARow: Longint; MoveAnchor,
Show: Boolean);
var
OldSel: TGridRect;
OldCurrent: TGridCoord;
begin
if (ACol < 0) or (ARow < 0) or (ACol >= ColCount) or (ARow >= RowCount) then
Show: Boolean);
var
OldSel: TGridRect;
OldCurrent: TGridCoord;
begin
if (ACol < 0) or (ARow < 0) or (ACol >= ColCount) or (ARow >= RowCount) then
InvalidOp(SIndexOutOfRange);
ACol 14
ColCount :2
所以出错了
这样处理一下
DBGridEh4->SelectedRows->Clear();
SetScrollPos(DBGridEh4->Handle,SB_HORZ,0,true);
TScrollInfo ScrollInfo;
ScrollInfo.cbSize = sizeof(ScrollInfo);
ScrollInfo.fMask = SIF_RANGE;
GetScrollInfo(DBGridEh4->Handle, SB_VERT, &ScrollInfo);
//SendMessage(DBGridEh4->Handle, WM_HSCROLL, SB_LEFT, 0); //不起作用
SendMessage(DBGridEh4->Handle, WM_HSCROLL, MAKEWPARAM(SB_THUMBPOSITION, long(&ScrollInfo)), 0);
ok了
滚动条
ScrollPos