请问如何判断Tsb键的光标停在DBGRID内的某一字段?我是想禁用TAB键新增行,只要Tab跳到最后一个字段要新增时,我就要
取消新增!
取消新增!
解决方案 »
- 求助 Delphi dbExpress里的SQLConnection连接MSSQL报错(DLL/Shared Library Name not Set)
- 如何定义属于类的常量?
- 关于TDBLookupComboBox的ItemHeight问题?Thanks!
- 再问个问题:在程序中显示机器的配置,如cpu ....?
- 那位会排列组合???
- 看到别人的代码我总是很羡慕,总觉得看起来很舒服,我的总是些垃圾样,提提意见,看我的结症在那里
- 哪有ODBC4.0下载,100分送好心人
- 高分求助,用.TXT作ADO数据源的问题,搞不明白,请帮忙!
- 怎么ADOQuery1可以查询不能插入!!!
- ado打包问题?
- 把数据载入TREEVIEW问题
- 找几个随时候命的师傅.
procedure TForm1.DBGrid1ColExit(Sender: TObject);
begin
if DBGrid1.SelectedField.FieldName = 'ff' then
ADOQuery1.Cancel;
end;
Shift: TShiftState);
var
s:string;
i,j,m,n:Integer;
begin
i:=self.DBGrid1.Columns.Grid.SelectedIndex;
j:=self.DBGrid1.Columns.Grid.FieldCount;
m:=self.DBGrid1.DataSource.DataSet.RecNo;
n:=self.DBGrid1.DataSource.DataSet.RecordCount;
if Key=9 then
begin
if (m<n) or ((n=m) and (i+1<j)) then
begin
if i+1<j then
self.Label1.Caption:=self.DBGrid1.Columns.Grid.Fields[i+1].FieldName
else
self.Label1.Caption:=self.DBGrid1.Columns.Grid.Fields[0].FieldName;
end
else
key:=0;
end;
end;