关于控件数组和动态数组?

bitter 2000-03-05 02:31:00
DELPHI中支持不定维数的数组,能否动态改变数组的值。
类似VB的
REDIM PRESERVE ARRAY[]。尤其是给数组增加新值。而保留以前的数据不变。。


另:
DELPHI中有无控件数组一说?
...全文
149 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
jwchc 2000-03-05
  • 打赏
  • 举报
回复
再给你介绍一篇文件,下载其全文看看就明白了。
jwchc 2000-03-05
  • 打赏
  • 举报
回复
再给你介绍一篇文件,下载其全文看看就明白了。
http://www.computerworld.com.cn/99/tips/9904/041608_05.asp
jwchc 2000-03-05
  • 打赏
  • 举报
回复
以下代码是根据条件,取数据库记录生成SPEEDBUTTON。希望对你有帮助。
var
MyB:array of TSpeedButton;
begin
Setlength(MyB,table1.RecordCount);
table1.First;
i:=0;
while not(table1.eof) do
begin
if table1.FieldByName('parent').asinteger=0 then
begin
MyB[I]:=TSpeedButton.Create(self);
MyB[I].Parent:=panel1;
{加入位置及宽高控制如:myb[i].width:=40;}
MyB[i].flat:=true;
MyB[i].caption:=trim(table1.fieldbyname('caption').asstring
Myb[i].onClick:=buttonclick;//按纽事件
i:=i+1;
end;
table1.next;
end;
end;
牛魔王的表弟 2000-03-05
  • 打赏
  • 举报
回复
控件数组的问题可以用下面的方法
var i:integer;
begin
for i:=0 to form1.ComponentCount-1 do
if (form1.Components[i] is TEdit) then
(form1.components[i] as TEdit).text:=inttostr(i);
end;

5,386

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧