private void btnSellerLogin_Click(object sender, EventArgs e) { Seller seller = LoginValidator.ValidateSeller(tbxSellerLoginId.Text, tbxSellerLoginPassword.Text); ParentForm mainForm = (ParentForm)MdiParent; if (seller != null) { mainForm.SellerLogin(seller); this.Hide(); } else { MessageBox.Show("Login Failed!\nWrong Id or Password"); } }