Reputation: 5520
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 ?
Upvotes: 0
Views: 308
Reputation: 169340
What about New Nullable(Of Boolean)
?
myThreeStateChkbox.IsChecked = If(myThreeStateChkbox.IsThreeState, New Nullable(Of Boolean), False)
Or shorter just New Boolean?
:
myThreeStateChkbox.IsChecked = If(myThreeStateChkbox.IsThreeState, New Boolean?, False)
Upvotes: 1