基本的に、テキストボックス、コンボボックス、リストボックス、ボタンがあります。コンボボックスの背景色を変更したい場合は、コンボボックスで「コンボボックス」を選択し、リストボックスで「背景色」オプションを選択します。テキストボックスは、値 (「赤」など) を入力するためのもので、ボタンを押すと、コンボボックスの背景色が赤に変わります。
これまでのところ、私はこれを持っています:
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;
どうすればそれを実現できますか?