I have two RadioButtons: r1 and r2.
I have to enable both on Enabled = true and disable only unchecked on Enabled = false
public bool Enabled
{
set
{
if(value)
{
r1.Enabled = value; // true
r2.Enabled = value;
}
else
{
if(!r1.Checked)
{
r1.Enabled = value; // false if not checked
}
if(!r2.Checked)
{
r2.Enabled = value;
}
}
}
}
Which operator have I to use to write each condition in one string?
The key is that the Enabled property is left as is when value is false and the corresponding check box is checked. So try this:
or