关于switch的有关问题
关于switch的问题C# code if (this.radioButton2.Checked){this.skinEngine1.SkinFile EmeraldColor2.s
关于switch的问题
C# code if (this.radioButton2.Checked) { this.skinEngine1.SkinFile = "EmeraldColor2.ssk"; return; } else if (this.radioButton3.Checked) { this.skinEngine1.SkinFile = "MidsummerColor2.ssk"; return; }
请问下 如果要转成 switch的话怎么写。 radiobutton 没有 selectvalue属性啊。。
[解决办法]你是判断它是不是被选中...
用switch的话不如直接用if else呢
foreach (RadioButton rad in this.Controls)
{
switch (rad.Name)
{
case "radioButton2":
if (radioButton2.Checked)
{ this.skinEngine1.SkinFile = "EmeraldColor2.ssk";
}
break;
case "radioButton3":
}
}