jag250
活跃成员
- 已加入
- 2020年9月16日
- 留言内容
- 28
- 编程经验
- 1-3
重置复选框和单选按钮:
rbPlain.Checked = false;
rbWheat.Checked = false;
rbEverything.Checked = false;
cbToasted.Checked = false;
cbCreamCheese.Checked = false;
我还需要帮助使陈述说百吉饼而不是百吉饼,如果(txtNumofBagels.Text!="1")
字符串strbagelName ="bagels";
字符串strNumberofBagels = txtNumofBagels.Text;
字符串strTypeofBagel = lblTypeof.Text;
字符串strToastedorNot;
字符串strCreamCheeseorNot;
C#:
if (rbPlain.Checked == true)
{
strTypeofBagel = " Plain ";
}
else if (rbWheat.Checked == true)
{
strTypeofBagel = "Wheat ";
}
else if (rbEverything.Checked == true)
{
strTypeofBagel = "Everything ";
}
// determine what word goes in for strbagelName
if (txtNumofBagels.Text != "1")
{
// add the word bagels
}
else
{
}
// determine what word goes in for strToasted
if (cbToasted.Checked == true)
{
strToastedorNot = "Toasted ";
}
else
{
strToastedorNot = "";
}
if (cbCreamCheese.Checked == true)
{
strCreamCheeseorNot = " with Cream Cheese";
}
else
{
strCreamCheeseorNot = "";
}
// determine what word goes in for strCreamCheese
lblTypeof.Text = strToastedorNot + strTypeofBagel + strbagelName + strCreamCheeseorNot;
// "Toasted" "Wheat" "bagels" "with cream cheese"