I am trying to use the shorthand notation for an if statement to shorten the following:
if (DCC.systemFlags[1]) { sf0CheckBox.Checked = true; } else { sf0CheckBox.Checked = false; }
And to use the following instead:
DCC.systemFlags[1] ? sf1CheckBox.Checked = true : sf1CheckBox.Checked = false;
However, I am not sure why I am getting the following error:
Only assignment, call, increment, decrement, and new object expressions can be used as a statement
What is the correct way to write this?
DCC.systemFlags[] is an array of bools.
Thank you.
What you actually want is this: