delphi中有没有象vb中的控件数组? 如果没有,有什么方法可以比较方便地像数组一样地操作一大批控件? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 type TForm1 = class(TForm) procedure FormCreate(Sender: TObject); private { Private declarations } FButtonList: array[0..10] of TButton; procedure ButtonClick(Sender: TObject); public { Public declarations } end;var Form1: TForm1;implementation{$R *.dfm}procedure TForm1.ButtonClick(Sender: TObject);begin ShowMessage(TButton(Sender).Name);end;procedure TForm1.FormCreate(Sender: TObject);var I: Integer;begin for I := Low(FButtonList) to High(FButtonList) do begin FButtonList[I] := TButton.Create(Self); FButtonList[I].Parent := Self; FButtonList[I].Top := I * (FButtonList[I].Height + 2); FButtonList[I].Name := Format('Button%d', [I]); FButtonList[I].Caption := FButtonList[I].Name; FButtonList[I].OnClick := ButtonClick; end;end; for i:=0 to form1.componentcount-1 dobegin form1.components[i]...... end; for i:=0 to form1.componentcount-1 dobegin if form1.components[i].ClassName='TCheckBox' then //然后将同类控件放入TListBox //...... end; //然后将同类控件放入TStringList 这就是控件数组:btn:array [1..100] of Tbutton delphi的if语句不理解 请问在三层中,更新一个表用如下方法出现错误,如何解决? 一個關於TreeView的問題 用语句生成的一个BUTTOM里面,如何判断该BUTTOM是否被按下??? 熟悉网吧计费管理系统开发的请进来看看 动态把imagelist图标加入listview第二列,第三列? 写store procedure的高手来看看,在线等...... Delphi6数据仓库问题 专攻还是博学? 工具栏怎么达到这样的效果?新人上路,请指点! delphi7使用idhttp进行网站post数据出现406错误问题 ●●●●100分求解关于dbgrid颜色特效问题●●●●
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
FButtonList: array[0..10] of TButton;
procedure ButtonClick(Sender: TObject);
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.ButtonClick(Sender: TObject);
begin
ShowMessage(TButton(Sender).Name);
end;procedure TForm1.FormCreate(Sender: TObject);
var
I: Integer;
begin
for I := Low(FButtonList) to High(FButtonList) do begin
FButtonList[I] := TButton.Create(Self);
FButtonList[I].Parent := Self;
FButtonList[I].Top := I * (FButtonList[I].Height + 2);
FButtonList[I].Name := Format('Button%d', [I]);
FButtonList[I].Caption := FButtonList[I].Name;
FButtonList[I].OnClick := ButtonClick;
end;
end;
begin
form1.components[i]......
end;
begin
if form1.components[i].ClassName='TCheckBox' then
//然后将同类控件放入TListBox
//......
end;
btn:array [1..100] of Tbutton