如何在Toolbar中動態添加Toolbutton
uj5u.com熱心網友回復:
vartb:TToolButton;
begin
tb:=TToolButton.Create(toolbar1);
tb.Parent:=toolbar1;
end;
uj5u.com熱心網友回復:
procedure TForm1.FormCreate(Sender: TObject);
begin
ToolBar1.ShowCaptions := True;
ToolBar1.Tag := 5;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
if ToolBar1.Tag = 0 then
Exit;
with TToolButton.Create(ToolBar1) do
begin
Caption := 'Button' + IntToStr(ToolBar1.Tag);
Style := tbsTextButton;
Parent := ToolBar1;
end;
ToolBar1.Tag := ToolBar1.Tag - 1;
end;
uj5u.com熱心網友回復:
怪了...上方二樓(#2)不見了是怎麼回是呢?這是我來 Delphi 板回覆帖子...第二次發生回覆資訊莫名消失......
已向 csdn 通報!
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/116039.html
標籤:VCL組件開發及應用
