private void timer1_Tick(object sender, EventArgs e) { timer1.Stop(); LoginForm f = new LoginForm(); f.Show(); this.Hide(); }
private void txtConpass_KeyDown(object sender, KeyEventArgs e) { if (e.KeyValue == (char)Keys.Enter) { try { if (string.IsNullOrEmpty(txtusername.Text)) { throw new Exception("Enter Username"); } else if (string.IsNullOrEmpty(txtpass.Text)) { throw new Exception("Enter Password"); } else if (string.IsNullOrEmpty(txtConpass.Text)) { throw new Exception("Confrim Password"); } else if (txtpass.Text == txtConpass.Text) { //call the insert class AdminLog.CreateAdmin(txtusername.Text, txtpass.Text); MessageBox.Show("Admin Created Succesfully\n\nPlease Set security questions after you\n" + "must have log in, to help Reset\n" + " your password if forgotten, thanks.", "Create Admin", MessageBoxButtons.OK, MessageBoxIcon.Information); var admin = new LoginForm(); this.Close(); admin.Show(); } else { throw new Exception("Password Mismatch"); } } catch (Exception Ex) { MessageBox.Show(Ex.Message, "Create Admin", MessageBoxButtons.OK, MessageBoxIcon.Information); } } }
private void button3_Click(object sender, EventArgs e) { LoginForm f = new LoginForm(); f.Show(); this.Close(); }
private void loginToolStripMenuItem_Click(object sender, EventArgs e) { LoginForm lf = new LoginForm(); lf.Show(); }
private void Form1_FormClosed(object sender, FormClosedEventArgs e) { //Hide(); login.Show(); }