Board index » delphi » Frames and Forms - Design vs. Run Time

Frames and Forms - Design vs. Run Time

I know how to create a frame and place it on a main form in Design time.
How do I do it at Run-time?   Don't want to populate my main form with the
Frame until I press a button to do it.   I can make the Frame invisible, but
that's not what I want.  Need to keep the main form empty until requested.
Not sure what the code is supposed to look like.

Mark

 

Re:Frames and Forms - Design vs. Run Time


"Mark Micklich" <markm...@pacbell.net> a crit dans le message news:
3e157...@newsgroups.borland.com...

Quote
> I know how to create a frame and place it on a main form in Design time.
> How do I do it at Run-time?   Don't want to populate my main form with the
> Frame until I press a button to do it.   I can make the Frame invisible,
but
> that's not what I want.  Need to keep the main form empty until requested.
> Not sure what the code is supposed to look like.

How about this? (untested)

procedure TForm1.Button1Click(Sender):TComponent);

begin
    TYourFrame.Create(Self).Parent:=Self;
end;

If you need to place your frame and adjust its size, zhen you'll have to
keep a reference to it while you do it (unless the frame does it by itself
in its constructor, based on the Owner and Parent properties)

HTH

IceCream

Re:Frames and Forms - Design vs. Run Time


Quote
Mark Micklich wrote:
> I know how to create a frame and place it on a main form in Design time.
> How do I do it at Run-time?   Don't want to populate my main form with the
> Frame until I press a button to do it.   I can make the Frame invisible, but
> that's not what I want.  Need to keep the main form empty until requested.
> Not sure what the code is supposed to look like.

> Mark

Mark,

A similar question popped up a few days ago.  Have a look in
b.p.attachments for a "TreeFrames" project.

Regards,
Scott

Other Threads