Dispose Form opened in MainForm tab

Posted by fireBand on Stack Overflow See other posts from Stack Overflow or by fireBand
Published on 2010-04-19T16:49:32Z Indexed on 2010/04/19 16:53 UTC
Read the original article Hit count: 354

Filed under:
|
|
|

Hi, I have a MainForm which has tab Control and several independent form. I open each Individual From in the tab of the main form. A "Close Tab" button on the MainFrom closes the current tab, its implementation is below.

This closes the current tab but what I also need is to dispose the From whose tab is closed but I am not sure how to get the instance of the form.'

Any help is appreciated Thanks in Advance.

'Close the current tab
  Private Sub CloseCurrentTab()
    'Close the current tab 

      Dim tabPageSave As TabPage
      tabPageSave = tcDisplayDetails.SelectedTab
      tcDisplayDetails.TabPages.Remove(tabPageSave)

End Sub

© Stack Overflow or respective owner

Related posts about vb.net

Related posts about tab