>In C# the entire clause after the "if" needs to get surrounded with parenthesis. Thanks to Java for that one. Not sure why Java does it that way.
Wouldn't think it came from Java? C has always used that syntax....
>
>>This worked:
>> if (this.chkAutoRequery.Checked == true)
>>
>>...interesting. I don't quite grasp the reason for the ( ) having to be like that but I'll get used to it (I hope...ha).
>>
>>
>>
>>>Try
>>>
>>>
if (this.checkbox.checked == true) {... }
>>>
>>>BTW, I was going to suggest value property without checking Help first.
>>>
>>>This is if chkAutoRequery.Checked() = true VFP code. In C# you need == to check for value equal something. And () for checking conditions.
>>>
>>>Got me couple of times too, BTW :)
>>>
>>>
>>>>Actually I tried that and I get a syntax error '(' expected....
>>>>
>>>>maybe I need a THIS for THISFORM or something like that in front of it?
>>>>
>>>>>Sooooooooooooooooooo close!
>>>>>
>>>>>"Checked" is a property. So no "()". Parentheses necessary for method calls.
>>>>>
>>>>>
>>>>>>Yippie! My first .NET question! (and yeah its realllly lame too .. haha)
>>>>>>
>>>>>>I have a checkbox I put on a form, and I'm trying to tell if it's been checked or not. I have something like this:
>>>>>>
>>>>>>if (dlgOpen.ShowDialog() == DialogResult.OK)
>>>>>> {
>>>>>> // Console.Write(dlgOpen.FileName);
>>>>>> crystalReportViewer1.ReportSource = dlgOpen.FileName;
>>>>>> if chkAutoRequery.Checked() = true
>>>>>> {
>>>>>> crystalReportViewer1.RefreshReport();
>>>>>> }
>>>>>> }
>>>>>>
>>>>>>
>>>>>>chkAutoRequery is the name of my checkbox - so its this line:
>>>>>> if chkAutoRequery.Checked() = true
>>>>>>..that I'm doing wrong. Anyone clue me in on the correct syntax?
>>>>>>
>>>>>>Thanks!