I want to create a custom panel control (a descendant of TToolBar) that should have some toolbar buttons by default.
So, I created a simple constructor that creates 1 button by default:
constructor ZMyToolbart.Create(AOwner: TComponent);
var
ToolButton : TToolButton;
begin
inherited;
Parent := Owner as TWinControl;
ToolButton := TToolButton.Create(Self);
ToolButton.Parent := Self;
ToolButton.Caption := 'Hallo';
end;
The problem is that after dragging and dropping a custom control on the form, the toolbar is displayed, but it does not appear in the object inspector as part of the toolbar.
If you tried to assign a button using the button property on the toolbar, this will not work. Maybe someone has advice on how to do this? thank!
source
share