jeudi 1 décembre 2016

Can i expand conditions to if in c#

I want to expand condition if checkbox is checked is it possible?

string Condition= "A==B"  
if (chechbox1.Checked==true)  
{  
    Condition+="&& B==C";  
}  
if (chechbox2.Checked==true)  
{  
    Condition+="&& C==D";  
}  
if (Condition)  
{  
    //do something  
}  

Aucun commentaire:

Enregistrer un commentaire