Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

HowTo create ToolBar/ToolButton at runtime

0 views
Skip to first unread message

The Sweed

unread,
Aug 8, 2000, 3:00:00 AM8/8/00
to
Hi,

Do someone have a hint about how to
create ToolBar with ToolButtons at
runtime ?

Chris


* Sent from AltaVista http://www.altavista.com Where you can also find related Web Pages, Images, Audios, Videos, News, and Shopping. Smart is Beautiful

De Kapitein

unread,
Aug 9, 2000, 3:00:00 AM8/9/00
to
Here you have it:

MyNewToolBar:=TToolbar.Create(form1);
MyNewToolBar.Parent:=form1;
MyNewButton:=TToolButton.Create(MyNewToolBar);
MyNewButton.Parent:=MyNewToolbar;

And don't forget: you need ComCtrls in the uses clause.

Gilles

The Sweed <christer.t.joh...@se.abb.com.invalid> wrote in message
news:00372b38...@usw-ex0109-069.remarq.com...

M.H. Avegaart

unread,
Aug 9, 2000, 3:00:00 AM8/9/00
to
You code works, but in general you should always specify the Form as the
Owner, so use:

MyNewToolBar := TToolbar.Create(Form1);
MyNewToolBar.Parent := Form1;
MyNewButton := TToolButton.Create(Form1);
MyNewButton.Parent := MyNewToolbar;


"De Kapitein" <kapi...@theship.com> schreef in bericht
news:8mr72m$fph$1...@porthos.nl.uu.net...

The Sweed

unread,
Aug 9, 2000, 3:00:00 AM8/9/00
to
Thank you guys for the informative answer !!
0 new messages