1
Answer

If statement syntax

spud trooper

spud trooper

17y
2k
1
I have a checkbox that depending on the checked state I will perform different operations.

I know one option is avaiable;

If (chk.Checked)
{
}
else
{
}

But I also know I can use something smilar to;

if chk.Checked(true) ? DoJob1 : DoJob2

The problem is that I can't get this second option to work. Can somebody please explain to me where and when the second example could be used?
Answers (1)