private void lbtnHome_Click(object sender, EventArgs e) { PharmSoft frmpharm = new PharmSoft(); this.Hide(); frmpharm.WindowState = FormWindowState.Maximized;//openning of mdi form in a maximised state frmpharm.ShowDialog(); this.Close(); }
private void btnclose_Click(object sender, EventArgs e) { var result = MessageBox.Show("Do you really want toclose this user form", "Close Form", MessageBoxButtons.YesNo, MessageBoxIcon.Information); switch (result) { case DialogResult.Yes: PharmSoft fr = new PharmSoft(); this.Hide(); fr.WindowState = FormWindowState.Maximized; //openning of mdi form in a maximised state this.Close(); fr.ShowDialog(); break; } }
private void btnok_Click(object sender, EventArgs e) { //validation if (txtusername.SelectedItem == "") { MessageBox.Show("Select username"); txtusername.Focus(); } else if (btnreset.Text == "") { MessageBox.Show("password is Required!"); btnreset.Focus(); } else { bool r = validate_login(txtusername.Text, btnreset.Text); if (r == true) { PharmSoft cs = new PharmSoft(); this.Hide(); cs.userid.Text = userid; cs.lblUsername.Text = username; cs.lblRole.Text = role; cs.lblFull_Name.Text = fullname; cs.Show(); } else { MessageBox.Show("incorrect login credentials"); txtusername.Text = ""; btnreset.Text = ""; txtusername.Focus(); } } }