private void txtPWD_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { MDIMain fm = new MDIMain(); if (Authenticated) { Program.AccountStatic.UserName = txtUserName.Text; Program.AccountStatic.CompanyID = 1000; Program.AccountStatic.IsAuthenticated = true; SetCompanyProfile(); this.Close(); } else { // fm.menuStrip1.Enabled = false; } } }