• Log in or sign up for an account here: https://www.sythe.org/login

Loading a form into a tabpage

dodge

Active Member
Joined
Mar 26, 2007
Sythe Gold
5
Messages
125
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
 
Runescape Gamblingrunescape gambling
Back
Top