コンボボックスから「ジュエリー」を選択すると「txt_qty & label6」が表示されますが、「textBox5 & label18」を選択すると表示されません。助けてくださいコンボボックス選択時にC#:if文エラーが発生しました
private void combo_main_type_SelectedIndexChanged(object sender, EventArgs e)
{
if ((string)combo_main_type.SelectedItem == "Jewelry")
{
txt_qty.Visible = true;
label6.Visible = true;
txt_qty.Location = new System.Drawing.Point(213, 343);
label6.Location = new System.Drawing.Point(40, 348);
}
else if ((string)combo_main_type.SelectedItem == "")
{
txt_qty.Visible = false;
label6.Visible = false;
}
else if ((string)combo_main_type.SelectedItem == "Gem")
{
textBox5.Visible = true;
label18.Visible = true;
textBox5.Location = new System.Drawing.Point(213, 343);
label18.Location = new System.Drawing.Point(40, 348);
}
else
{
textBox5.Visible = false;
label18.Visible = false;
}
}
txt_qtyとlabel6をfalseにする必要があります。 –
はい私もそれを行いました..しかし、それでもまだ動作していません –