Connecting Tech Pros Worldwide Help | Site Map

How to create: Form inside tab

  #1  
Old July 2nd, 2009, 10:50 PM
Newbie
 
Join Date: Jul 2009
Posts: 6
I was wondering if it was possible to have a form inside a tab control? So when a tab is clicked, there is a form within it.

If it is possible, then how should I go about doing it?

Thank you.

Last edited by Frinavale; July 21st, 2009 at 09:23 PM. Reason: Duplicate questions mearged.
  #2  
Old July 3rd, 2009, 01:10 AM
tlhintoq's Avatar
Moderator
 
Join Date: Mar 2008
Location: Arizona, USA
Posts: 1,690
Provided Answers: 3

re: How to create: Form inside tab


A 'form', meaning a System.Windows.Forms.Form control? No, I don't think you can do that.

You can make a user control that is all the controls you would want, then drop that on the Tabpage or drop it on a Form and be able to use it either way.
  #3  
Old July 3rd, 2009, 02:34 PM
insertAlias's Avatar
Forum Leader
 
Join Date: Apr 2008
Location: San Antonio, TX (USA)
Posts: 2,569

re: How to create: Form inside tab


Please provide more specific details in your question, including which technology you are using (ASP.NET, Windows Forms, WPF, etc) and what Framework version you are using.

Also, Form is a very vague word. Do you mean System.Windows.Form, the HTML Form tag, or the generic meaning of a bunch of input fields? Please be more specific.
  #4  
Old July 8th, 2009, 07:19 PM
Newbie
 
Join Date: Jul 2009
Posts: 6

re: How to create: Form inside tab


Hi, I am using Microsoft Visual 2008 C#. And would like to create a subform inside if a form. All the tutorials online ask me to click on the "Control Wizard" button and the "Form/Subform" button on the toolbox, which I am unable to find. Is there something which needs top be downloaded or the form opened in a special way?
  #5  
Old July 9th, 2009, 05:34 PM
Plater's Avatar
Moderator
 
Join Date: Apr 2007
Location: New England
Posts: 7,096
Provided Answers: 3

re: How to create: Form inside tab


You can infact stick a windows form inside a tab control. I went that route with one of my projects. I found it easier to code for each "tab" seperately.

Here's a snipit I use:
Expand|Select|Wrap|Line Numbers
  1. //in the form with the tab control:
  2. MyForm stc = new MyForm();
  3. stc.TopLevel = false;
  4. stc.Parent = this;
  5. stc.Dock = DockStyle.Fill;
  6. stc.FormBorderStyle = FormBorderStyle.None;
  7. tabTheTabIWantTheFormToBeIn.Controls.Add(stc);
  8. stc.Show();
  9.  
Setting the TopLevel proeprty to false is the key thing to do.
  #6  
Old July 9th, 2009, 07:25 PM
Newbie
 
Join Date: Jul 2009
Posts: 6

re: How to create: Form inside tab


Thank you so much :D
Reply


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tab Control - Block CTRL+Tab Kbalz answers 17 March 7th, 2007 02:15 AM
Need an alternative to multiple inheritance **Developer** answers 8 December 3rd, 2005 04:25 PM
Multi-Project solution - how to show form from other project. Gary Kahrau answers 3 November 21st, 2005 07:47 AM
Tab control within another tab control Paul Mendez answers 5 November 13th, 2005 02:34 AM