Einzelnen Beitrag anzeigen

uwewo

Registriert seit: 14. Jul 2004
Ort: Karlsruhe
479 Beiträge
 
Delphi 2006 Professional
 
#5

Re: ToolButton - Größe zur Laufzeit einstellen?

  Alt 22. Sep 2006, 12:49
Also bei mir funktioniert das

Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var
  TB: TToolButton;
  i: integer;
begin
  for i := StrToInt(Edit1.Text) downto 1 do
  begin
    TB := TToolbutton.Create(self);
    TB.Parent := ToolBar;
    TB.Caption := IntToStr(i);
    TB.ShowHint := True;
    TB.Hint := 'Button ' + IntToStr(i);
    TB.style := tbsButton;
  end;
     ToolBar.ButtonHeight := 35;
     ToolBar.ButtonWidth := 35;
end;
Und bei Dir sicher auch.
Außerdem muß Du noch im OI die ToolBar auf AutoSize setzen.
Uwe
  Mit Zitat antworten Zitat