For Programmers: Free Programming Magazines  


Home > Archive > Delphi > October 2005 > Problem creating CustomComponent









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Problem creating CustomComponent
Mateusz [PEYN] Adamus

2005-10-07, 7:02 pm

Hi.

I'm creating my own component, nothing much, just to panels, one put on
another.

I've created my custom constructor:

constructor TMyPanel.Create( aOwner: TComponent );
begin
inherited Create( aOwner );

FInnerPanel := TPanel.Create( self );
FInnerPanel.Parent := self;
FInnerPanel.Align := alRight;
FInnerPanel.BevelOuter := bvNone;
FInnerPanel.Caption := 'InnerPanel';

DoubleBuffered := True;
end;

As you can see I create second panel and put it on the "main" component.
(component inherites from TPanel).

Everything works fine until I try to make project with MyPanel. I put
MyPanel on form, get nice view of panel with another panel in it. But
now I'd like to put some other components in this inner panel - I can't
do it :-( I put components on it, and it looks like they are in it but
when I look at object tree view I can see that components are put on
form, not on InnerPanel :-(

When I move them to MyPanel they are put on main panel of MyPanel - not
on inner one.

I think I have to make somehow delphi to see inner panel - so it would
be shown in object tree view. How can I do such thing?

TIA

Best regards
Mateusz [PEYN] Adamus
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com