Solved

Form Unload in vb.net

Posted on 2015-01-08
2
230 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 34

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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…

710 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