locked
Opening forms in tab control RRS feed

  • Question

  • I'm new to non internet programing. But I got to start somewhere. So i'll try and make this simple

    I have a MDI parent form with a tab control section. From a link in the toolbar i would like to open a diffrent form in my tab section. This is what I figured out so far if its even close.


    Private Sub NewCustomerToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NewCustomerToolStripMenuItem.Click

    newcustomerinfoform = newcustomerinfoform
    TabPage1.Controls.Add(newcustomerinfoform)

    End Sub


    The name of my main form is Main.vb and the child form i want to load into the tab is newcustomerinfoform.info

    Any help would be appreciated.

    • Edited by Andrew.M Monday, July 13, 2009 5:10 AM
    Thursday, July 9, 2009 3:12 AM

Answers

  •     Private Sub NewToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NewToolStripMenuItem.Click
            Dim custForm As New newcustomerinfoform
            custForm.Show()
            custForm.TopLevel = False
            TabPage1.Controls.Add(custForm)
            'you might want to try uncommenting following line :-)
            'custForm.WindowState = FormWindowState.Maximized
        End Sub

    Thanks

    - Omie
    Someone makes my heart skip a clock cycle !
    • Proposed as answer by Kenneth Haugland Friday, July 10, 2009 5:46 PM
    • Marked as answer by Andrew.M Monday, July 13, 2009 1:09 AM
    Thursday, July 9, 2009 4:53 AM

All replies

  •     Private Sub NewToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NewToolStripMenuItem.Click
            Dim custForm As New newcustomerinfoform
            custForm.Show()
            custForm.TopLevel = False
            TabPage1.Controls.Add(custForm)
            'you might want to try uncommenting following line :-)
            'custForm.WindowState = FormWindowState.Maximized
        End Sub

    Thanks

    - Omie
    Someone makes my heart skip a clock cycle !
    • Proposed as answer by Kenneth Haugland Friday, July 10, 2009 5:46 PM
    • Marked as answer by Andrew.M Monday, July 13, 2009 1:09 AM
    Thursday, July 9, 2009 4:53 AM
  • Thanks alot. :)
    Friday, July 10, 2009 12:53 AM