如何跳到Grid指定的单元格 RT, 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 楼主是不是说StringGrid呢如果是的话:sg.rows := a //指定的行sg.cols := b //指定的列sg.setfocus //得到焦点 StrngGrid 中定位Cell[1,1] //cell[1,1],你可以根据要求自己来写!procedure TForm1.Button1Click(Sender: TObject);//可变通为定位任意CellVar myRect:TGridRect;begin myRect.Left := 1; //left right 控制col, top bottom 控制row myRect.Top := 1; myRect.Right := 1; myRect.Bottom := 1; StringGrid1.Selection := myRect;end; 无论何种Grid都可以,主要是这是当初别人写的一个Grid,现在用条码扫描输入的时候,完了要直接跳到下一行记录的同个单元格 StringGrid1.Row := 2; StringGrid1.Col := 3; StringGrid1.SetFocus; Edit1.Text := StringGrid1.Cells[StringGrid1.Col, StringGrid1.Row]; dbgrid1.selectedfield := dbgrid1.datasource.date.fieldbyname('aa'); TstringGrid(dbgrid1).Row:=2; TstringGrid(dbgrid1).Col:=3; TstringGrid(dbgrid1).SetFocus; 关于TBITMAP类的使用求助 delphi 滚动条的问题~single型数值不能设定 小弟求教各位大侠一个关于DELPHI问题! delphi调用web service问题 adoquery的问题关于insert into的![cqwty (笨小孩)] 关于SERVER页的EXCEL的有关的函数 请问怎么读取一个TXT文件里来判断他里面是不是空的(即TXT里没有内容) opendialog相关问题? treeview,dbgrid的问题。 通过发送关闭消息来关闭指定的程序 关于socket端口问题? DELPHI数据库的问题?
如果是的话:
sg.rows := a //指定的行
sg.cols := b //指定的列sg.setfocus //得到焦点
procedure TForm1.Button1Click(Sender: TObject);//可变通为定位任意Cell
Var
myRect:TGridRect;
begin
myRect.Left := 1; //left right 控制col, top bottom 控制row
myRect.Top := 1;
myRect.Right := 1;
myRect.Bottom := 1;
StringGrid1.Selection := myRect;
end;
StringGrid1.Col := 3;
StringGrid1.SetFocus;
Edit1.Text := StringGrid1.Cells[StringGrid1.Col, StringGrid1.Row];
TstringGrid(dbgrid1).Col:=3;
TstringGrid(dbgrid1).SetFocus;