Loading a form into a tabpage

Discussion in 'Programming General' started by dodge, May 14, 2007.

Loading a form into a tabpage
  1. Unread #1 - May 14, 2007 at 3:17 PM
  2. dodge
    Joined:
    Mar 26, 2007
    Posts:
    125
    Referrals:
    1
    Sythe Gold:
    5

    dodge Active Member
    Banned

    Loading a form into a tabpage

    Create one main form add a toolstrip and a with a button and add this code to the button click event

    Code:
    Dim nTabpage As New TabPage()
            nTabpage.Margin = New Padding(0)
            Me.TabControl1.TabPages.Add(nTabpage)
    
            Dim frmUser As New Form2
            frmUser.TopLevel = False
            frmUser.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
            frmUser.Parent = nTabpage
            frmUser.Dock = DockStyle.Fill
            frmUser.Margin = New Padding(0)
    
    
            nTabpage.Controls.Add(frmUser)
    
            frmUser.Show()
    
    add a tabcontrol to the form

    create a second form in this case named form2 and add some controls to it

    every time you click on the button on the tool of your main form bar you will get a new tab with the second form loaded into it
     
< automatically add - to a multiline textbox | [TuT] Parsing HTML >

Users viewing this thread
1 guest


 
 
Adblock breaks this site