mercredi 31 mai 2017

WPF/VB How to set a threestate checkbox (or nullable boolean) to Nothing(null)

The title explain all itself. For VB the keyword Nothing is the same as False.

This code verify if checkbox is a three state checkbox, and set the default value, indeterminate if is a "three state", and false if is not.

myThreeStateChkbox.IsChecked = If(myThreeStateChkbox.IsThreeState, Nothing, False)

The result is the same, always False. How can I set the indeterminate state ?




Aucun commentaire:

Enregistrer un commentaire