Question radio buttons and check boxes

Status
Not open for further replies.

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"
 
Please reopen your topic and post your code within code tags, just like everyone else is required to do.

CodeTags.gif


Had you listened to me the first time when I last asked you to do this, you'd likely have an answer on your topic. Instead, you have me breathing down your neck for not following a simple request.
 
Status
Not open for further replies.
Back
Top Bottom