private void SetRadiobuttonDisplayProgram(enumDisplayProgram value) { switch (value) { case enumDisplayProgram.Any: radioButtonChAll.Checked = true; break; case enumDisplayProgram.None: radioButtonChNone.Checked = true; break; case enumDisplayProgram.Selected: radioButtonChSelected.Checked = true; break; } }
private void textBoxSearchNameProgram_TextChanged(object sender, EventArgs e) { if (string.IsNullOrEmpty(textBoxSearchNameProgram.Text)) { CheckboxAnychannelChangedByCode = true; SetRadiobuttonDisplayProgram(backupCheckboxAnychannel); radioButtonChAll.Enabled = radioButtonChNone.Enabled = radioButtonChSelected.Enabled = true; } else if (radioButtonChAll.Checked) // not empty and checkbox is still enabled { CheckboxAnychannelChangedByCode = true; backupCheckboxAnychannel = ReturnDisplayProgram(); SetRadiobuttonDisplayProgram(enumDisplayProgram.Any); radioButtonChAll.Enabled = radioButtonChNone.Enabled = radioButtonChSelected.Enabled = false; } }