Validated if textbox is empty and not empty ,and what is the proper if else statement:
Code:
private void btnSave_Click(object sender, EventArgs e)
{
if (txtFName.Text == "")
{
labelID.Text = "!";
}
if (txtLName.Text == "")
{
labelLN.Text = "!";
}
if (txtMI.Text == "")
{
labelMN.Text = "!";
}
if (cmbGender.Text == "")
{
labelGender.Text = "!";
}
if (cmbCollege.Text == "")
{
labelCollege.Text = "!";
}
if (txtFName.Text == "" || txtLName.Text == "" || txtMI.Text=="" || cmbGender.Text=="" || cmbCollege.Text=="")
{
MessageBox.Show("Fill up the remaining field/s");
}
Comment