So, I am making a login screen for my application and when you login correctly, it should open form2. But, when I do login correctly it opens form2 then closes it very quickly. Here is my code. (I am using bunifu buttons and text-boxes)
Private Sub BunifuThinButton21_Click(sender As Object, e As EventArgs) Handles BunifuThinButton21.Click
If BunifuTextbox1.text = "admin" And BunifuTextbox2.text = "adminpass" Then
Me.Close()
Form2.Show()
Else
If BunifuTextbox1.text = "" And BunifuTextbox2.text = "" Then
MsgBox("No Username Or Password Found!", MsgBoxStyle.Critical, "Error")
Else
If BunifuTextbox1.text = "" Then
MsgBox("No Username Found!", MsgBoxStyle.Critical, "Error")
Else
If BunifuTextbox2.text = "" Then
MsgBox("No Password Found!", MsgBoxStyle.Critical, "Error")
Else
MsgBox("Invalid Username And/Or Password!", MsgBoxStyle.Critical, "Error")
End If
End If
End If
End If
End Sub