samedi 19 mai 2018

How to create a method where multiple controls are false in an "if" statement for C#?

What is the best way to simplify this (via method creation or otherwise):

if ((radioButton1.Checked == false) && (radioButton2.Checked == false) && (radioButton1.Checked == false) && ...more similar controls... && ((radioButton99.Checked == false))
{ 
    MessageBox.Show("Please select an option!);
}

Thank you for your consideration. Apologies for any inconvenience or grievances caused.

Aucun commentaire:

Enregistrer un commentaire