没有问题呀,在设计组件时直接把其它控件加进去就行了
例:
组件定义: TListBar = class(TCustomControl)
private
{ Private declarations }
WorkAreas :TWinControl;
MenuButton, ItemButton :array of TListButton;
UpButton, DownButton, CloseButton :TListButton;
构造过程:
Constructor TListBar.Create(Owner :TComponent);
begin
inherited Create(Owner);
Width:=135;
Height:=300;
...
CloseButton :=TListButton.Create(Self);
CloseButton.Parent:=Self;
CloseButton.ButtonStyle :=btnsIE;
CloseButton.ButtonFlag :=btnfUpArrow;
// CloseButton.BevelWidth :=1;
CloseButton.OnClick :=DoTitleClick;
WorkAreas:=TWinControl.Create(Self);
WorkAreas.Parent :=Self;
UpButton :=TListButton.Create(WorkAreas);
UpButton.Parent:=WorkAreas;
UpButton.ButtonStyle :=btnsNormal;
UpButton.ButtonFlag :=btnfUpArrow;
UpButton.BevelColor :=clBlack;
UpButton.Width :=16;
UpButton.Height :=16;
UpButton.OnClick :=UpButtonClick;
...