Newbie question on VB.Net app

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have a VB.Net Winsows application, the application display a login
form(Login.vb) to do user authentication, if valid use application will hide
the login form and show another form (MainForm.vb). Here is the code snippet
in Login.vb.

' if authentication is good, do the following
Dim mform As New MainForm
Me.Hide()
mform.ShowDialog()
' end code snippet

In MainForm.vb , I have a close button. Here is the handler:
Private Sub BtnClose_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles BtnClose.Click
Me.Close()
Me.Dispose()
End Sub

My question is , when users click BtnClose in MainForm.vb, does the
application end? I only hide Login.vb, does .net runtime knows it's not used
and close it?

TIA
 
No, your application will continue running, because Login form still
"alive". Just close the Login form on openning the MainForm.

Dim mform As New MainForm
mform.ShowDialog()
Me.Close()
 
Back
Top