我在一个窗口中使用StingGrid,但由于数据太多(10*5),而且演示的时候需要改变部分数据,我不想在每次运行时都输入一遍,请问如何在设计就对表格输入数据呢?
不会用下面这种方法吧?
StringGrid1.Cells[1,1]:=
StringGrid1.Cells[2,1]:=
......
StringGrid1.Cells[10,1]:=
StringGrid1.Cells[1,2]:=
StringGrid1.Cells[2,2]:=
......
StringGrid1.Cells[10,2]:=
......
StringGrid1.Cells[9,5]:=
StringGrid1.Cells[10,5]:=
能不能像edit那样设计时在窗口直接赋值?或像一维数组那样(23,27,31,24,27,31,30,36,39,30,36,39,50,9999,9999)?
不会用下面这种方法吧?
StringGrid1.Cells[1,1]:=
StringGrid1.Cells[2,1]:=
......
StringGrid1.Cells[10,1]:=
StringGrid1.Cells[1,2]:=
StringGrid1.Cells[2,2]:=
......
StringGrid1.Cells[10,2]:=
......
StringGrid1.Cells[9,5]:=
StringGrid1.Cells[10,5]:=
能不能像edit那样设计时在窗口直接赋值?或像一维数组那样(23,27,31,24,27,31,30,36,39,30,36,39,50,9999,9999)?
解决方案 »
- delphi调用C写的dll,无法调用多数组参数的函数
- idhttp 问题,谢谢!!
- 找出最接近某个数字的值
- 100分~~~~~~~如何实现根据多个下拉菜单,动态生成SQL语句!!
- 程序员都改行算了
- delphi2010,MainMenu Autohotkey设为 maManual还是不行,怎么弄呀?
- 散分!!!google怎么了?
- delphi ShellExecute()同时打开多个网页怎么实现
- 在哪里、如何设置DELPHI原代码的对齐方式。
- 见鬼!在MDI中用TRichEdit.FindText出现问题???
- 100分:用ADODATESET将日期更新为‘2008-1-1’时候,自动变为‘08-1-1’
- 请教图片怎么加到chm文档制作工具里面去?
例如:
StringGrid1.Cells[1,1]:= 23;
StringGrid1.Cells[2,1]:= 27;
StringGrid1.Cells[3,1]:= 24;
StringGrid1.Cells[4,1]:= 27;
StringGrid1.Cells[5,1]:= 30;
StringGrid1.Cells[6,1]:= 36;
StringGrid1.Cells[7,1]:= 30;
StringGrid1.Cells[8,1]:= 36;
StringGrid1.Cells[9,1]:= 50;
StringGrid1.Cells[10,1]:=9999;
能不能用(23,27,24,27,30,36,30,36,50,9999)数组的方式或设计时在窗体StringGrid1中设好初始值。
这些数小部分在运行时会手工输入改变!
data :array[0..1,0..1] of integer=
( (1,2),(3,4));var
i,j:integer;with stringgrid1 do
begin
rowcount := length(data);
colcount := length(data[0]);
for i:=0 to High(data) do
for j:=0 to High(Data[0]) do
cells[j,i] := inttostr(data[i][j]);
end;