ToolBar也动态生成好了
procedure TForm1.Button1Click(Sender: TObject);
var MyToolButton:TToolButton;
MyToolBar:TToolBar;
i:integer;
begin
MyToolBar:=TToolBar.Create(self);
MyToolBar.Parent:=Form1;
MyToolBar.Height:=300;
MyToolBar.Show;
for i:=1 to 10 do
begin
MyToolButton:=TToolButton.Create(self);
MyToolButton.Parent:=MyToolBar;
MyToolButton.Wrap:=True;
MyToolButton.Top:=i*10;
MyToolButton.Show;
end;
end;
先放一个ToolBar
procedure TForm1.Button1Click(Sender: TObject);
var MyToolButton:TToolButton;
i:integer;
begin
for i:=1 to 10 do
begin
MyToolButton:=TToolButton.Create(self);
MyToolButton.Parent:=ToolBar1;
MyToolButton.Wrap:=True;
MyToolButton.Top:=i*10;
MyToolButton.Show;
end;
end;