D
David Hearn
I am having a problem trying to close or hide (have tried it both
ways) one form and showing another. The initial form is a login form.
If they get the username and password correct, I want it to go to
frmMain and close the login screen since it won't be needed anymore.
If I try either one, the application gets lost somewhere. I can go
into running apps and see that the application is still there and
eventually find it but it is like it is getting hidden behind the
desktop. What am I doing wrong?
Here is the code I am using:
Private Sub btnLogin_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnLogin.Click
If txtUserName.Text.Length = 0 Then
MessageBox.Show("UserName Required!")
Exit Sub
ElseIf txtPassword.Text.Length = 0 Then
MessageBox.Show("Password Required!")
Exit Sub
End If
Dim objMain As New frmMain
objMain.Show()
objMain.Focus()
Me.Close() 'I have tried Me.Hide[] here also
End Sub
ways) one form and showing another. The initial form is a login form.
If they get the username and password correct, I want it to go to
frmMain and close the login screen since it won't be needed anymore.
If I try either one, the application gets lost somewhere. I can go
into running apps and see that the application is still there and
eventually find it but it is like it is getting hidden behind the
desktop. What am I doing wrong?
Here is the code I am using:
Private Sub btnLogin_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnLogin.Click
If txtUserName.Text.Length = 0 Then
MessageBox.Show("UserName Required!")
Exit Sub
ElseIf txtPassword.Text.Length = 0 Then
MessageBox.Show("Password Required!")
Exit Sub
End If
Dim objMain As New frmMain
objMain.Show()
objMain.Focus()
Me.Close() 'I have tried Me.Hide[] here also
End Sub