jag250
Active member
- Joined
- Sep 16, 2020
- Messages
- 28
- Programming Experience
- 1-3
reset checkbox and radiobuttons:
rbPlain.Checked = false;
rbWheat.Checked = false;
rbEverything.Checked = false;
cbToasted.Checked = false;
cbCreamCheese.Checked = false;
Also I need help with making the statement say bagel not bagels if (txtNumofBagels.Text != "1")
string strbagelName = "bagels";
string strNumberofBagels = txtNumofBagels.Text;
string strTypeofBagel = lblTypeof.Text;
string strToastedorNot;
string 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"