Reputation: 467
I have a ComboBox
control. When a particular item is selected, I would like to disable some RadioButton
controls.
Is there any particular event that I could use to do that?
Upvotes: 1
Views: 475
Reputation: 6637
You could do
private void ComboBox1_SelectedIndexChanged(object sender,
System.EventArgs e)
{
if(((ComboBox)sender).SelectedItem.ToString() == "your value")
radioBtn1.IsEnabled = false;
}
Upvotes: 0
Reputation: 78457
You can use SelectionChanged
event.
private void comboBox1_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
radioButton1.IsEnabled = comboBox1.SelectedItem == x;
// or
radioButton1.IsEnabled = comboBox1.SelectedValue == x;
}
Upvotes: 3