Gets a value that indicates whether a ButtonBase is currently activated.
Assembly: PresentationFramework (in PresentationFramework.dll)
is the state of a button that indicates the left mouse button or SPACEBAR is pressed over the button. When is true, the control captures the mouse. As a result, the control will raise mouse events such as MouseEnter and IsMouseDirectlyOverChanged. Note that using the AccessText or ENTER does not change or capture the mouse, but is does raise the Click event.
Starting with the .NET Framework version 3.0 Service Pack 1, has a protected setter. To use this functionality, your application should target the .NET Framework version 3.5. For more information, see .NET Framework Versions and Dependencies.
This example shows how to use the property in a trigger style.
<Style x:Key="Triggers" TargetType="Button"> <Style.Triggers> <Trigger Property="IsMouseOver" Value="true"> <Setter Property = "Background" Value="Red"/> </Trigger> <Trigger Property="IsPressed" Value="true"> <Setter Property = "Foreground" Value="Green"/> </Trigger> </Style.Triggers> </Style>
Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)