B
bgqy2000
Unregistered / Unconfirmed
GUEST, unregistred user!
现在有2个dbgrid分别为dbgrid1,dbgrid2;还有四个button按钮为上下左右,现在我想实现用鼠标点上下按钮时,在dbgrid中的记录指针上下移动,请帮忙解决下。把我写的帖出来大家也可以指点下。
//上
procedure TfrmShtHx.acUpExecute(Sender: TObject);
begin
inherited;
acDown.Visible := true;
Postmessage(DGWare.Handle,WM_VSCROLL,-1,1);
if CDSSubTmp.Bof then
acUp.Visible :=false;
end;
//下
procedure TfrmShtHx.acDownExecute(Sender: TObject);
begin
inherited;
acUp.Visible := true;
Postmessage(DGWare.Handle,WM_VSCROLL,0,0);
if CDSSubTmp.Bof then
acDown.Visible :=false;
end;
//上
procedure TfrmShtHx.acUpExecute(Sender: TObject);
begin
inherited;
acDown.Visible := true;
Postmessage(DGWare.Handle,WM_VSCROLL,-1,1);
if CDSSubTmp.Bof then
acUp.Visible :=false;
end;
//下
procedure TfrmShtHx.acDownExecute(Sender: TObject);
begin
inherited;
acUp.Visible := true;
Postmessage(DGWare.Handle,WM_VSCROLL,0,0);
if CDSSubTmp.Bof then
acDown.Visible :=false;
end;