So I basicly have a textbox, combobox, listbox and button. When I'd like to change the backcolor of the combobox, i'd select the "combobox" in combobox and then choose the option "backcolor" in the listbox. Textbox is for typing the value (for example "red") in and when i'd press the button, the backcolor of the combobox would change to red.
So far I have this:
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
listBox1.Items.Clear();
switch (comboBox1.SelectedIndex)
{
case 0:
listBox1.Items.Add("BackColor");
if (listBox1.SelectedIndex == 0 && textBox1.Text=="red")
{
//????
}
listBox1.Items.Add("Font");
listBox1.Items.Add("ForeColor");
listBox1.Items.Add("Font style");
break;
How do I make that happen?