private void AddGroup() { int numberOfGroups = _comboBoxGroups.Count; ComboBoxGroupUserControl newComboBoxGroupUserControl = new ComboBoxGroupUserControl(); newComboBoxGroupUserControl.InitializeNotFirst(); newComboBoxGroupUserControl.TabIndex = 9 + numberOfGroups; newComboBoxGroupUserControl.Name = string.Format("comboBoxGroupUserControl{0}", numberOfGroups + 1); flowLayoutPanel1.Controls.Add(newComboBoxGroupUserControl); InitializeParanthesBeginComboBoxe(newComboBoxGroupUserControl.GetParanthesBeginComboBox()); InitializeParanthesEndComboBoxe(newComboBoxGroupUserControl.GetParanthesEndComboBox()); InitializeAndOrComboBox(newComboBoxGroupUserControl.GetAndOrComboBox()); InitializeColumnComboBox(newComboBoxGroupUserControl.GetColumnComboBox()); InitializeOperatorComboBox(newComboBoxGroupUserControl.GetOperatorComboBox()); InitializeToolTip(newComboBoxGroupUserControl.GetValueComboBox(), _searchBoxToolTipText); newComboBoxGroupUserControl.GetColumnComboBox().SelectedIndexChanged += ColumnComboBox_SelectedIndexChanged; newComboBoxGroupUserControl.GetValueComboBox().KeyDown += ValueComboBox_KeyDown; newComboBoxGroupUserControl.GetEnabledCheckBox().CheckedChanged += EnabledCheckBox1_CheckedChanged; newComboBoxGroupUserControl.ReloadValuesCheckBoxChangedEvent += ComboBoxGroup_ReloadValuesCheckBoxChangedEvent; _comboBoxGroups.Add(newComboBoxGroupUserControl); flowLayoutPanel1.ScrollControlIntoView(newComboBoxGroupUserControl); removeButton.Enabled = true; }
private static void EnabledCheckBoxChanged(CheckBox checkBox) { ComboBoxGroupUserControl comboBoxGroupUserControl = (ComboBoxGroupUserControl)checkBox.Parent; comboBoxGroupUserControl.GetAndOrComboBox().Enabled = checkBox.Checked; comboBoxGroupUserControl.GetColumnComboBox().Enabled = checkBox.Checked; comboBoxGroupUserControl.GetParanthesBeginComboBox().Enabled = checkBox.Checked; comboBoxGroupUserControl.GetParanthesEndComboBox().Enabled = checkBox.Checked; if (comboBoxGroupUserControl.GetColumnComboBox().SelectedIndex > 0) { comboBoxGroupUserControl.GetOperatorComboBox().Enabled = checkBox.Checked; comboBoxGroupUserControl.GetValueComboBox().Enabled = checkBox.Checked; } }
private void ComboBoxGroup_ReloadValuesCheckBoxChangedEvent(object sender) { ComboBoxGroupUserControl comboBoxGroupUserControl = (ComboBoxGroupUserControl)sender; ComboBox columnComboBox = comboBoxGroupUserControl.GetColumnComboBox(); InitializeValueComboBox(columnComboBox); }