IsPressed Property

ButtonBase.IsPressed Property


Gets a value that indicates whether a ButtonBase is currently activated.

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

public bool IsPressed { get; protected set; }

Property Value

Type: System.Boolean

true if the ButtonBase is activated; otherwise false. The default is false.

IsPressed is the state of a button that indicates the left mouse button or SPACEBAR is pressed over the button. When IsPressed 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 IsPressed or capture the mouse, but is does raise the Click event.

Starting with the .NET Framework version 3.0 Service Pack 1, IsPressed 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.

Identifier field


Metadata properties set to true


This example shows how to use the IsPressed property in a trigger style.

.NET Framework
Available since 3.0
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Return to top
© 2015 Microsoft