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()
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top