M
M
MainNika2010-11-10 11:11:04
Lazarus
MainNika, 2010-11-10 11:11:04

Question about Delphi (Lazarus)?

There is a TToolBar on the form. On it, respectively, the TToolButton buttons.
How can you programmatically move (swap) the buttons on this ToolBar while the program is running?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
H
Horse, 2010-11-10
@MainNika

procedure TForm1.FormCreate(Sender: TObject);
var temp: integer;
begin
temp := ToolButton1.Left;
ToolButton1.Left := ToolButton2.Left;
ToolButton2.Left := ToolButton1.Left;
end;

N
nickkee, 2010-11-10
@nickkee

Horse has a typo, you need to do this:
procedure TForm1.FormCreate(Sender: TObject);
var temp: integer;
begin
temp := ToolButton1.Left;
ToolButton1.Left := ToolButton2.Left;
ToolButton2.Left := temp;
end;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question