private void loginBtn_Click(object sender, EventArgs e) { Button MyBtn = (Button)sender; switch (MyBtn.Name) { case "loginBtn": if (LoginValidation()) { this.Hide(); Passbook passbook = new Passbook(); passbook.UserName = nameTextbox.Text; passbook.Show(); } else { MessageBox.Show("Wrong Password Id"); } break; case "registerBtn": this.Hide(); Register register = new Register(); register.Show(); break; } }
private void passBookToolStripMenuItem_Click(object sender, EventArgs e) { Passbook passbookForm = null; CloseForm(); foreach (Form f in this.MdiChildren) { if (f is Passbook) { // found it passbookForm = (Passbook)f; break; } } if (passbookForm != null) { passbookForm.Show(); passbookForm.Location = new Point(0, 0); passbookForm.Focus(); } else { passbookForm = new Passbook(this); passbookForm.MdiParent = this; passbookForm.Show(); passbookForm.Location = new Point(0, 0); passbookForm.Focus(); } }
private void transactionBtn_Click(object sender, EventArgs e) { Button MyBtn = (Button)sender; switch (MyBtn.Name) { case "transactionBtn": DoTransaction(); this.Hide(); Passbook passbook = new Passbook(); passbook.UserName = name; passbook.Show(); break; } }