I have the following problem, I got a button that’s create each time I clicked on it a Combobox with 16 Items. ComboBox Item 0, 7, 10 and 14 are CheckBoxes, which have an event handler. If Checkbox 0 is checked, the items from 1 till 5 are visible if unchecked they collapsed, same with the other Checkboxes. So I tried this
private void Blasa(object sender, RoutedEventArgs e)
{
CheckBox chx = (CheckBox)sender;
foreach(ComboBox cb in licb)
{
for (int i = 1; i < 5; i++)
{
((ComboBoxItem)(cb.Items[i])).Visibility = Visibility.Visible;
}
}
}
(licb = list of ComboBox) I just try that with one Checkbox, it works, but if the second ComboBox appears the Checked event from the first created Checkbox will also set the Items visibility from the second Combobox to visible… The Checkboxes shut only Hide and Shows the Items in their Parents Control, does anyone has an idea? im using WPF.
Aucun commentaire:
Enregistrer un commentaire