Partager via


ToggleButton.IsThreeState Property

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Gets or sets whether the control supports two or three states.

Namespace:  System.Windows.Controls.Primitives
Assembly:  System.Windows (in System.Windows.dll)

Syntax

'Declaration
Public Property IsThreeState As Boolean
public bool IsThreeState { get; set; }
<togglebutton IsThreeState="bool"/>

XAML Values

Property Value

Type: System.Boolean
true if the control supports three states; otherwise, false. The default is false.

Remarks

Dependency property identifier field: IsThreeStateProperty

The IsChecked property can be set to nulla null reference (Nothing in Visual Basic) as a third state when IsThreeState is true.

Examples

The following example shows how to create a three-state ToggleButton control.

<ToggleButton Margin="5" Content="Three State" Width="150" IsThreeState="True"/>
<ToggleButton Margin="5" Content="Two State" Width="150" IsThreeState="False" />

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.