//沒有測試,你自己測試一下吧
var
i,j,m,n:integer;
sTmp :string;
begin
for i:=0 to stringgrid1.Rowcount do
for j := 0 to stringgrid1.colcount do
begin
sTmp := Trim(stringgrid1.cell[i,j]);
if sTmp = '' then
begin
ShowMessage(IntToStr(i+1)+' Row and '+ IntToStr(j+1) + ' Col is Null!');
Exit;
end; for m := i to stringgrid1.Rowcount do
for n := 0 to stringgrid1.colcount do
begin
if sTmp = Trim(stringgrid1.cell[m,n]) then
begin
ShowMessage(IntToStr(i+1)+' Row and '+ IntToStr(j+1) + ' Col ='+
IntToStr(m+1)+' Row and '+ IntToStr(n+1) + ' Col!');
Exit;
end;
end;
end;
end;
var
i,j,m,n:integer;
sTmp :string;
begin
for i:=0 to stringgrid1.Rowcount do
for j := 0 to stringgrid1.colcount do
begin
sTmp := Trim(stringgrid1.cell[i,j]);
if sTmp = '' then
begin
ShowMessage(IntToStr(i+1)+' Row and '+ IntToStr(j+1) + ' Col is Null!');
Exit;
end; for m := i to stringgrid1.Rowcount do
for n := 0 to stringgrid1.colcount do
begin
if sTmp = Trim(stringgrid1.cell[m,n]) then
begin
ShowMessage(IntToStr(i+1)+' Row and '+ IntToStr(j+1) + ' Col ='+
IntToStr(m+1)+' Row and '+ IntToStr(n+1) + ' Col!');
Exit;
end;
end;
end;
end;
解决方案 »
- 关于cxGrid多条记录添加的问题
- delphi调试时出现的异常在哪里查!或者找帮助!
- 什么工具可以查看JSY格式的文件呢
- 在线求教,菜鸟问题,如何在鼠标移到某个菜单项上时,在状态栏中显示出相应的提示信息,请大哥赐教!
- 一个让我困惑的问题!!
- 我如何能在运行程序的时候让我的电脑屏幕呈现windows关机时候的“虚屏”现象?
- 非打印字符为什么不能显示???()
- 怎样在UniCode和Ansi之间转化?
- QuickReport 问题?
- 如果只用一个Query,不用Database,怎样去掉那个数据库密码保护框呢?
- 急急急
- delphi 6中如何用database(主程序调用一个写好的dll文件时,dll中的database 和主体的database)
var i_count,i_row,i_col :integer;
begin
if trim(stringgrid1.Cells[x,y])='' then
begin
showmessage('为空!');
exit;
end;
i_count:=0;
for i_row:=0 to stringgrid1.RowCount-1 do
begin
for i_col:=0 to stringgrid1.ColCount-1 do
begin
if stringgrid1.cells[x,y]=
stringgrid1.cells[i_col,i_row then
i_count:=i_count + 1;
if i_count>1 then
begin
showmessage('跟第i_row行、第i_col列一致!');
exit;
end;
end;
end;end;
var i_row,i_col:integer;
begin
if trim(stringgrid1.Cells[x,y])='' then
begin
showmessage('为空!');
exit;
end;
for i_row:=0 to stringgrid1.RowCount-1 do
begin
for i_col:=0 to stringgrid1.ColCount-1 do
begin
if stringgrid1.cells[x,y]=
stringgrid1.cells[i_col,i_row] then
begin
if (i_row<>y) or (i_col<>x) then
begin
showmessage('跟第' + i_row +'行、第' + i_col + '列一致!');
exit;
end;
end;
end;
end;end;
请见晾