jag250
Active member
- Joined
- Sep 16, 2020
- Messages
- 28
- Programming Experience
- 1-3
can anyone help me with resetting radio buttons and checkboxes? I need them to rest if I click the back button.
I tried it this way and I tried using an if statement.
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")
{
// add the word bagels
}
The rest of my code is
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"
I tried it this way and I tried using an if statement.
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")
{
// add the word bagels
}
The rest of my code is
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"