🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.lang.pascal.delphi.components.writing
2 messages
2 total messages Started by Greg Lubel Thu, 08 Oct 1998 00:00
creating components within components
#31
Author: Greg Lubel
Date: Thu, 08 Oct 1998 00:00
17 lines
1496 bytes
I want to create a TCustomControl (a coloured circle) with a caption and
an image area. (Delphi 3 Pro)

I have created the TCustomControl and I've tried adding a create
'CaptionLabel:Tlabel', firstly in the create method and then in the
paint method of my CustomControl. I have managed to compile both these
attempts but neither render the label when I instantiate a CustomControl
at run time. Firstly, is this the correct way to approach this? If it
is, what do I use as 'parent' for the CaptionLabel. Will the same
solution apply to an 'IconImage:TBitmap' or any other embellishments? If
possible I'd really appreciate a small but fully worked example or if
not, then the key points.

Thanks,


Greg
Re: creating components within components
#32
Author: Roel Spapens
Date: Thu, 08 Oct 1998 00:00
34 lines
1836 bytes
for the captionlabel you should do something like
OnCreate
begin
  captionlabel:=Tlabel.Create(Self);
  captionlabel.parent:=Self;
  captionlabel.visible:=true;
  // set it's position
end;

for other components about the same applies.

HTH

  Roel


In comp.lang.pascal.delphi.misc Greg Lubel <"<NOSPAM> wrote:
> I want to create a TCustomControl (a coloured circle) with a caption and
> an image area. (Delphi 3 Pro)

> I have created the TCustomControl and I've tried adding a create
> 'CaptionLabel:Tlabel', firstly in the create method and then in the
> paint method of my CustomControl. I have managed to compile both these
> attempts but neither render the label when I instantiate a CustomControl
> at run time. Firstly, is this the correct way to approach this? If it
> is, what do I use as 'parent' for the CaptionLabel. Will the same
> solution apply to an 'IconImage:TBitmap' or any other embellishments? If
> possible I'd really appreciate a small but fully worked example or if
> not, then the key points.

> Thanks,


> Greg
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads