Link to home
Start Free TrialLog in
Avatar of agrees
agrees

asked on

Easy newbie question: how to get a checkbox's status

Hi All,

I'm a complete and utter newbie to C# as this question will demonstrate...
 
I have a windows form containing a checkbox and all I want to do is read in whether the checkbox is ticked or not.  I would have thought this would do it:

myCheckbox.Checked()

but it doesn't - the compiler complains that "Checked" is a property and not a function.  Could someone please help me?  MSN is fairly useless and google searches throw up a vast amount of irrelevant information - experts-exchange is my only hope! :)

Alex
ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of PoeticAudio
PoeticAudio

if(myCheckBox.Checked)
{
      MessageBox.Show("Its checked");
}
else
{
      MessageBox.Show("its not checked");
}
Avatar of agrees

ASKER

Odd.. I'm sure that didn't work yesterday - oh well, thanks :)