如題
解决方案 »
- 算法高手请进! 求Delphi中树的表示方法(不要告诉我用TreeView)
- 关于checkListBox的问题……
- 请问下大家,正版的DELPHI7在哪里有得卖呢?还有价格是多少呢?谢谢
- 请问谁用过Raize Components v3.0.9这组控件里面的RzBalloonHints1,请问怎样使他在需要的时候能在托盘显示消息
- ★★★升水星了★★★
- 求药品对照库一个
- 熟悉dbgrideh 的朋友帮个忙吧!!!!!
- 电视台播节目的控制软件问题,up有分!
- ███Delphi access数据库 提醒功能怎么实现?请高手赐教,小弟不甚感激!████
- sql server2000数据库问题?
- 小妹是新手,请各位多多指教!!
- 请教:打印最简单的方法。
i:integer;
begin
for i:=1 to stringgrid.ColCount-1 do
begin
stringgrid.Cells[i,RowNum]:='';
end;
end;
是什麼東西?怎麼以得呢?
你這只是清空呀,沒有刪除呀,我要刪除就好了,大家幫我呀
i,j:integer;
iPos:integer;
begin
iPos:=StringGrid1.Row;
for i:=iPos to StringGrid1.RowCount-1 do
begin
for j:=0 to StringGrid1.ColCount-1 do
StringGrid1.Cells[j,i]:=StringGrid1.Cells[j,i+1];
end;
StringGrid1.RowCount:=StringGrid1.RowCount-1;
end;
type
TMyGrid = class(TStringgrid); 之后,删除时:你可以这样写:
TMyGrid(Grid).DeleteRow(Grid.Row); //Grid为你的StringGrid控件说明:DeleteRow方法是TCustomGrid类申明的protected方法,可以删除表格中的一行;而TStringGrid没有将这一方法公开出来(意味着其他类将无法访问),所以你只需要定义一个从TStringGrid类继承的新类就可以了。
var r,c,rcount :integer;
begin
with stringgrid1 do
begin
rcount:=rowcount;
for r:=i to rcount-2 do
for c:=0 to colcount-1 do
cells[c,r]:=cells[c,r+1];
dec(rcount);
RowCount:=rcount;
end
end;