I have done the following in a LoginForm:
Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click
If UsernameTextBox.Text = ("username") And PasswordTextBox.Text = ("password") Then MainMenu.Show(Me.Hide) Else MsgBox("Wrong")
End Sub
But it gives me the following error:
Error 1 Expression does not produce a value (on Me.Hide)
If the LoginForm is the “startup” for the application, note that other forms will become children of this form. You’ll be able to close the application one with Application.Exit() which is really not a good practice. You should close the application by closing the “startup” form.
With that said, Ranhiru is correct.