如何把一大堆按钮当作一维数组使用,下标是个变量的那种?
解决方案 »
- delphi indy邮件 html内容带链接的问题
- HELP ADO连接EXCLE的问题 急死人了 。。。。。。。。。。。。。。解决了 马上给分 嫌少再加 前两个帖子怎么进不去了 再开一个100分的 日 散尽家产 分不够再加
- 关于程序版本识别和自动更新问题
- 去北京找老婆应注意什么
- 3件喜事,UP有分!
- 困惑:网络数据库编程用什么语言最好?请大家来读者讨论,来者有分。
- delphi抽奖软件
- delphi中用深麼函數來實現程序暫停一小段時間?
- DELPHI制作服务程序问题
- 怎么能保存LISTBOX按件的数据到我指定的数据文件中!
- 各位大哥,请帮帮小弟!
- 急求高手解决中间层程序动态创建adoQuery和DataSetProvider的问题!!!
动态创建按钮,将按钮的caption赋值为循环中的那个变量就ok了你说的下标是不是caption
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, StdCtrls;type
TForm1 = class(TForm)
TreeView1: TTreeView;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;
aa:array of tbutton;implementationuses Unit2;{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
var
i:integer;
begin
setlength(aa,10);
for i:=1 to 10 do
begin
aa[i]:=tbutton.Create(self);
aa[i].Caption:=inttostr(i);
aa[i].Parent:=form1;
aa[i].Visible:=true;
aa[i].Top:=i*10;
end;
end;end.