Solved

Form Unload in vb.net

Posted on 2015-01-08
2
220 Views
Last Modified: 2015-01-08
Hi Experts,

I have tab control with 4 tabs. When I click the tab it loads a form. How can I unload the form when I go to the next tab.

Thank you.
0
Comment
Question by:RadhaKrishnaKiJaya
2 Comments
 
LVL 33

Accepted Solution

by:
it_saige earned 500 total points
ID: 40539005
You could always use <yourformvariable>.Close(), e.g. -
' Make a variable that holds a reference to Tab Form instances.
Private tabForm As Form;
' Somewhere in your code, lets say a button click for TabOne
Private Sub OnTabOneButtonClick(ByVal sender As Object, ByVal e As EventArgs) Handles TabOneButton.Click
     tabForm = New TabOneForm()
     tabForm.Show()
End Sub

Private Sub OnTabSelected(ByVal sender As Object, ByVal e As TabControlEventArgs) Handles MainTabControl.Selected
     If Not tabForm Is Nothing
          tabForm.Close()
     End If
End Sub

Open in new window


This is completely untested and just off the top of my head.

-saige-
0
 

Author Closing Comment

by:RadhaKrishnaKiJaya
ID: 40539062
Thank u very much for your help.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question