按一个按钮。使dbgrid的某一个字段自动拥有焦点。就象edit1.setfocus.那样。在dbgrid中怎样表示? 如按一下button1.光标自动跳到dbgrid的某一个字段中。字段拥用焦点如何表示? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Query.Frist;TDrawGrid(DBGrid1).Col:=1;DBGrid1.setFocus;第一行第一列 容易dbgrid1.DataSource.DataSet.Fields[i].FocusControl;其中i表示你要的字段数!比如1,2,3,等 dbgrid1.SetFocus; dbgrid1.SelectedIndex:=0; dbgrid1.SetFocus;dbgrid1.SelectedIndex:=i;//i为你想要自动拥有焦点的那个字段在dbgrid中的顺序索引号 DBGridKeyPressbeginif key=#13 thenif DBGrid1.selectedinedx<(DBGrid1.fieldcount-1) thenDBGrid1.selectedindex:=DBGrid1.selectedindex+1;elsebeginif not table1.eof thenbegintable1.next;DBGrid1.SelectedIndex:=0;end;end;end; ???SQL语句中如何引用Edit1中的字符串长??? 每天都很晕 cxGrid怎样用语句绑定数据源啊? ExpressQuantumGrid4.21(在线等待) 请问如何用代码给WIN2K添加个帐号 ?? 怎么得到一个hwnd的name的值。 怎样制作注册表扫描软件?送100分? 有没有能把flash可执行文件转换成源文件的软件? 怎样在另一个程序的 EDIT 填上文本?请帮助 一个小问题,请看看 各位大虾们,请教一条SQL日期查询语句。 请问如何读取一个exe文件的第一个字节的16进制的值,并用label显示出来??
TDrawGrid(DBGrid1).Col:=1;
DBGrid1.setFocus;
第一行第一列
dbgrid1.SelectedIndex:=0;
dbgrid1.SelectedIndex:=i;//i为你想要自动拥有焦点的那个字段在dbgrid中的顺序索引号
begin
if key=#13 then
if DBGrid1.selectedinedx<(DBGrid1.fieldcount-1) then
DBGrid1.selectedindex:=DBGrid1.selectedindex+1;
else
begin
if not table1.eof then
begin
table1.next;
DBGrid1.SelectedIndex:=0;
end;
end;
end;