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

  • Thread starter Thread starter Tony Johansson
  • Start date Start date
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
 
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.
 
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.
 
Back
Top