J
jingping
Unregistered / Unconfirmed
GUEST, unregistred user!
原代码如下:
type
private
CSpeedButton: TSpeedButton;
procedure cspeedButtonClick(Sender:TObject);
procedure TForm1.SpeedButton5Click(Sender: TObject);
var
Bnum,Bxh,Bnumber:integer;
begin
Bnumber:=table2.RecordCount;
Bnum:=1;
with Table2 do First;
for Bxh:=1 to Bnumber do
begin
cSpeedButton:=TSpeedButton.Create(self);
cSpeedButton.Parent:=panel2;
cSpeedButton.Caption:=Table2['aaa'];
cSpeedButton.name:='SpeedButton'+inttostr(BNum);
cSpeedButton.OnClick:=cspeedButtonClick;
Bnum:=Bnum+1;
table2.next;
end;
end;
type
private
CSpeedButton: TSpeedButton;
procedure cspeedButtonClick(Sender:TObject);
procedure TForm1.SpeedButton5Click(Sender: TObject);
var
Bnum,Bxh,Bnumber:integer;
begin
Bnumber:=table2.RecordCount;
Bnum:=1;
with Table2 do First;
for Bxh:=1 to Bnumber do
begin
cSpeedButton:=TSpeedButton.Create(self);
cSpeedButton.Parent:=panel2;
cSpeedButton.Caption:=Table2['aaa'];
cSpeedButton.name:='SpeedButton'+inttostr(BNum);
cSpeedButton.OnClick:=cspeedButtonClick;
Bnum:=Bnum+1;
table2.next;
end;
end;