Forms in Tab control

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I want to dispaly different forms in different tab pages of tab
control. How can I do this?
any help is appreciated.
Regards,
RbsnBph
 
Hi,
I want to dispaly different forms in different tab pages of tab
control. How can I do this?
any help is appreciated.
Regards,
RbsnBph

I suggest to use UserControls instead of Forms. That's kind of the
"official" way.
 
A "quick-and-dirty" way to do it is this.
Your "inner" froms, that is the ones that you want to put on the tabs
sheets, should have a "none" borderstyle.

On the constructor of your container form, the one with the tabsheets you
should have code somewhat like this:

// myInnerForm is the form to be placed inside the tabpage
myInnerForm.SetBounds(TabPage1.Bounds.X,TabPage1.Bounds.Y,
TabPage1.Bounds.Width, TabPage1.Bounds.Height);

TabPage1.Controls.Add(myInnerForm);
// tabMain is the TabControl
tabMain.TabPages.Add(pTabPage1);

It worked fine for me, hope it works for you too
 
I don't think a form can be displayed within tab or can be a child control of
a tab. What you need is a control that simulates the appearance of a form.
For this one you may try adxSuperPanel. At www.gzdsoftware.com
Avi
 
RbanBph said:
I want to dispaly different forms in different tab pages of tab
control. How can I do this?
any help is appreciated.

You can do that using usercontrols (composite controls):

"Project" -> "Add user control...".
 
Back
Top