Jump to content

elements in run time


jahlxx
 Share

Recommended Posts

Hi.

 

I do what I put in the code below, but can't get the expected.

 

I have a tabcontrol, and dinamically, I create a tabsheet inside that tabcontrol, a frame inside the tabsheet, a panel inside the freme, ans finally, I want to show the form inside the panel  I'm not sure that I need the panel, but is not the problem. I've tested whithout the panel, and the result is the same.

 

Everything is ok, but form is never inside the panel.

 

I need some help, please.

 

 

// Create TabSheet
xtab := TUniTabSheet.Create(Self);
xtab.PageControl := xpages;
xtab.Closable := True;
xtab.Tag := 'aaaaaaaaa';
xtab.name := 'tab1';
xtab.Caption := 'tab1';
xtab.align := alclient;
xtab.layout := 'fit';

// Create Frame
xframe := TUniFrame.Create(self);
xframe.Parent := xtab;
xframe.Align := alclient;
xframe.layout := 'absolute';

// Create Panel
xpanel := TUniPanel.Create(self);
xpanel.parent := xframe;
xpanel.align := alclient;
xpanel.layout := 'fit';

// Mostrar el form dentro del panel del tabsheet
xform.Parent := xpanel;
xform.align := alclient;
xform.layout := 'fit';
xform.Show();
 

 

 

Link to comment
Share on other sites

I think, that I neither need the frame.

 

I think the problem is assign the parent of the form in run time, becasuse the form is already created, and if I maximize the form, is not maximized in the tabsheet, it is maximized in the mainform.

 

Some help please.

Link to comment
Share on other sites

sorry. I posted this in the wrong topic.

 

I put it here.

 

I'm trying to simulate the mainform in the all features demos, but without having a frame for every form.

 

Create the frame in run time and assignn a form to that frame, but I can't find the way to do this.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...