private void Loginbtn_Click(object sender, EventArgs e) { if (usernameTxt.Text == null || usernameTxt.Text == "Enter Username") { usErrorLable.Visible = true; } else { usErrorLable.Visible = false; } if (passwordTxt.Text == null || passwordTxt.Text == "Password") { PAssErrorLable.Visible = true; } else { PAssErrorLable.Visible = false; } if (usErrorLable.Visible || PAssErrorLable.Visible) { MainClass.ShowMSG("Fields with * are required ", "Required", "Error"); } else { if (Main.staffLogin(usernameTxt.Text, passwordTxt.Text)) { HomeScreen HS = new HomeScreen(); MainClass.showwindows(HS, this, MDI.ActiveForm); } else { MainClass.ShowMSG("Invalid Login Details", "Error", "Error"); } } }