1。TStringGrid [1] - ColCount、RowCount、Cells
cCount := StringGrid1.ColCount;
{获取总列数}
rCount := StringGrid1.RowCount;
{获取总行数}
{给每个单元赋值}
for c :=
0
to StringGrid1.ColCount -
1
do
for r :=
0
to StringGrid1.RowCount -
1
do
StringGrid1.Cells[c,r] := Format('%d,%d',
[c,r]);
2.DefaultColWidth、DefaultRowHeight、Col、Row
1、修改 StringGrid 单元的默认宽与高;
2、添加行和列;
{添加一行}
StringGrid1.RowCount := StringGrid1.RowCount + 1;
{添加一列......
阅读全文