Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click Try Dim AuthData As New GetData.GetData() Dim DT As DataTable = AuthData.GetAuthentication(UsernameTextBox.Text, PasswordTextBox.Text) Dim Password As String = DT.Rows(0).Item(0).ToString If (Password = PasswordTextBox.Text) Then MsgBox("Login Successful") Me.Close() MainForm.Show() Else MsgBox("Invalid Password. Please Try Again") End If Catch EX As Exception MsgBox("UserName Not Registered. Please enter a Valid Username and Continue") End Try End Sub
Startup form
Shutdown mode
When startup form closes
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)