private void btnRemove_Click(object sender, System.EventArgs e) { if (this.listBox1.SelectedItem != null) { string colorGroup = this.listBox1.SelectedItem.ToString(); if (colorGroup != "Theme Colors" && colorGroup != "Standard Colors" && colorGroup != "Recent Colors") { ColorUIAdvGroup group = GetColorUIAdvGroupObject(colorGroup); if (group != null) { this.colorPickerUIAdv.CustomGroups.Remove(group); FillInListBox(); this.listBox1.SelectedIndex = this.listBox1.Items.Count - 1; } } else { MessageBox.Show("You can remove only custom group colors"); } } else { this.listBox1.SelectedIndex = this.listBox1.Items.Count - 1; } }
private void btnAdd_Click(object sender, System.EventArgs e) { ColorUIAdvGroup group = new ColorUIAdvGroup(this.colorPickerUIAdv, Syncfusion.Windows.Forms.Tools.ColorUIAdvGroups.CustomColors, true); this.colorPickerUIAdv.CustomGroups.Add(group); FillInListBox(); this.listBox1.SelectedIndex = this.listBox1.Items.Count - 1; }