private void openingFormButton_Click(object sender, EventArgs e) { OpeningForm openingForm = new OpeningForm(); openingForm.FormClosed += delegate(object source, FormClosedEventArgs args) { this.Visible = true; }; openingForm.Show(); }
private void btnSignIn_Click(object sender, EventArgs e) { if (cmbPosition.Text == "Manager") { if (txtUserName == null || txtPassword == null) { MessageBox.Show("Please Fill the Field"); } else { string userName = txtUserName.Text; string password = txtPassword.Text; if (userName == "admin" && password == "admin") { OpeningForm op = new OpeningForm(); op.Show(); } else { MessageBox.Show("Please try to valid authentication"); } } } }