Hi currently with 1 combobox,textbo x and a OK button which the button will enabled once my textbox is not empty.
But now i want to add the condition where both the combobox and textbox is also not empty then the button will enable...how can i do so?
Code:
private void locacodeBox_TextChanged(object sender, EventArgs e)
{
TextBox textBox = sender as TextBox;
if (locacodeBox.Text.Length == 0)
locacodeBox.Tag = false;
else
locacodeBox.Tag = true;
ValidateButton();
}
private void ValidateButton()
{
this.newlocaBtn.Enabled = (bool)locacodeBox.Tag;
}
Comment