如何在设计期建立控件数组 如标题 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } public procedure buttonClick(sender:TObject); { Public declarations } end;var Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);var button:TButton;begin button:=Tbutton.create(self); button.Parent:=self; button.Caption:=datetostr(now); button.OnClick:=buttonClick;//自己给个循环就可以了end;procedure TForm1.buttonClick(sender:TObject);begin //按钮名称这样取: showmessage(TButton(sender).Caption); if TButton(sender).Name='buttonname' then begin //执行你要的代码! end;end; delphi好像不支持设计期的控件数组。 将按扭按一定顺序放在一个panel上,然后运行时就可以用panel.Component[i]检索到相应的按扭了这算不算是数组了? sorry 理解错了 ,delphi 不提供控件数组 VB里有. delphi 只能一个个的复制张贴 DBgrid中的3列有计算关系,要求实时显示结果,如何写代码实现? 急、急、急 100分求Combobox多字段的下拉菜单效果,求高手指点 什么叫整型原子? 放掉所有分 怎样把数据流转换成字符串? 关于webbrowser的两个问题! form中的上面蓝边如何去掉 将数据插入系统中时发生错误。。。 vc调用delphi的dll的参数类型问题。 请教:如何根据加载数据库中的字段来实现按钮的属性 怎么办?急!在线等待! 求救--在fastreport教本编辑里面为什么输不了汉字??(急) 求《Delphi 分布式多层应用---系统篇》电子版
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
procedure buttonClick(sender:TObject);
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
var button:TButton;
begin
button:=Tbutton.create(self);
button.Parent:=self;
button.Caption:=datetostr(now);
button.OnClick:=buttonClick;
//自己给个循环就可以了
end;procedure TForm1.buttonClick(sender:TObject);
begin
//按钮名称这样取:
showmessage(TButton(sender).Caption);
if TButton(sender).Name='buttonname' then
begin
//执行你要的代码!
end;
end;
panel.Component[i]检索到相应的按扭了
这算不算是数组了?