Hi Sotoasty.
I was so messed up that I didn't have any code to show. What I ended up doing was hiding the login form. But that alone wasn't good enouh becuase when I closed the main form Visual Studio had the Blue square (stop debugging) icon lit up. The program was still running. So I added a Form_Closing event by using the lighting bolt and added Application.Exit. So that took care of the running program. It all works now. Thanks.
in the login form
Code:
private void cmdLogin_Click(object sender, EventArgs e)
{
if (txtUserID.Text.ToLower() == "guest" && txtPassword.Text.ToLower() == "password")
{
frmMain frmObj = new frmMain();
frmObj.Show();
this.Hide();
}
else
{
MessageBox.Show("Login incorrect: UserID = guest and password is password");
txtUserID.Text = "";
txtPassword.Text = "";
txtUserID.Focus();
}
}
in the main form
Code:
private void frmMain_FormClosing(object sender, FormClosingEventArgs e)
{
Application.Exit();
}
Bookmarks