可以用sendmessage,想dbgrid 发键盘信息,
按下shift键,同时按下button1
procedure TForm1.Button1Click(Sender: TObject);
var
i:integer;
begin
for i:=1 to Table1.Recordcount-1 do
sendmessage(DbGRID1.handle,WM_KEYDOWN,VK_DOWN,1);
end;
Set CurrentRowSelected to specify whether the Bookmark string of the associated
DBGrid抯 dataset should be included in the bookmark list. Setting CurrentRowSelected
to True adds the Bookmark property of the dataset to the Items array if it is not
already there. Setting CurrentRowSelected to False removes the Bookmark of the
dataset from the Items array if it is there. If the Bookmark property of the
dataset is an empty string (no bookmark), setting CurrentRowSelected does nothing.