Results 1 to 1 of 1
2002-11-06, 21:12 #1
- Join Date
- Nov 2002
- Thanked 0 Times in 0 Posts
program not closing after hiding/showing main form (.net)
the program is for a ficticious video rental store. you start off with a login screen and type in a user name and password. the program checks it against a list of those and sends the user to either a customer or an employee screen.
If strUser.ToLower = "cust" Then
ElseIf strUser.ToLower = "emp" Then
MessageBox.Show("Wrong Username or Password. Please try again.", "Error.", MessageBoxButtons.OK, MessageBoxIcon.Warning)
ClearForm() ' runs the ClearForm sub
I've stepped through the code and the program seems to just ignore the Me.Close(). I was having a problem before I fiddled with it when the form would hide, but when it was shown after closing the emp/cust form, the program wouldn't end and would stay resident in memory.
here's code from the customer form (the user has to input a password before they can exit it, so ignore that junk):
Private Sub frmCustomer_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
Dim strInput As String = ""
Dim strPassword As String
Dim frmLogin As New frmLogin()
strPassword = InputBox("Password:", "Exit Password", strInput)
If strPassword.ToLower = "exitout" Then
MessageBox.Show("Wrong Password.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
e.Cancel = True
what am I missing? why isn't the computer doing what I think I'm telling it to do!? [img]/forums/images/smilies/smile.gif[/img] any help is appreciated!