
10.07.2011, 22:13
|
 |
.
|
|
Регистрация: 18.05.2011
Адрес: Омск
Сообщения: 3,970
Версия Delphi: 3,5,7,10,12,XE2
Репутация: выкл
|
|
Этот код:
Код:
Procedure CreateButtons(DirName: string);
begin
Sbutton1:= TSoundButton.Create(Form1);//ñîçäà¸ì êíîïêó íà ôîðìå
with Sbutton1 do
begin
Name:= 'SButton' + inttostr(ButCount);
.....
parent:=form1.ScrollBox1;
Sbutton1.OnClick := Form1.SButtonClick;
But[ButCount]:= Sbutton1;
//form1.ListBox1.Items.Add(Sbutton1.Name);
end;
Top_:= Top_ + 30;
Inc (ButCount);
end;
фигня. Немного подправим:
Код:
...
ButCount := 0; // где то на старте
Procedure CreateButtons(DirName: string);
begin
SetLength(But, ButCount + 1);
But[ButCount] := TSoundButton.Create(Form1);//ñîçäà¸ì êíîïêó íà ôîðìå
with But[ButCount] do
begin
Name:= 'SButton' + inttostr(ButCount + 1);
.....
parent:=form1.ScrollBox1;
Sbutton1.OnClick := Form1.SButtonClick;
// But[ButCount]:= Sbutton1;
//form1.ListBox1.Items.Add(Sbutton1.Name);
end;
inc(Top_, 30);
inc(ButCount);
end;
|