Why does .NET have these two statement which have a identical functionality

T

Tony Johansson

Hello!

The CheckBox control has two important properties, Checked and CheckState.
The Checked
property returns either true or false. The CheckState property returns
either Checked or
Unchecked:

So why exist both the Checked and CheckState ? It would be enough with one
of these.

//Tony
 
R

reasonman

Hello!

The CheckBox control has two important properties, Checked and CheckState.
The Checked
property returns either true or false. The CheckState property returns
either Checked or
Unchecked:

So why exist both the Checked and CheckState ? It would be enough with one
of these.

//Tony

I'm not entirely sure why two are needed, but CheckState reports on 3
states, Checked, Unchecked and Indeterminate(checked but shaded).
Checked returns true on checked and indeterminate, and false on
unchecked.
 
J

Jeff Johnson

I'm not entirely sure why two are needed, but CheckState reports on 3
states, Checked, Unchecked and Indeterminate(checked but shaded).
Checked returns true on checked and indeterminate, and false on
unchecked.

Check boxes can be placed in "tri-state" mode, in which case the CheckState
property tells you the actual state of the check. If you're not in tri-state
mode then all you need to look at is the Checked property.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top