Solved

Form Unload in vb.net

Posted on 2015-01-08
2
224 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

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

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

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

828 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