(0) exportieren Drucken
Alle erweitern

ButtonBase.IsPressed-Eigenschaft

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

Namespace: System.Windows.Controls.Primitives
Assembly: PresentationFramework (in presentationframework.dll)
XML-Namespaces:  http://schemas.microsoft.com/winfx/2006/xaml/presentation

public bool IsPressed { get; }
/** @property */
public boolean get_IsPressed ()

public function get IsPressed () : boolean

Sie können diese Eigenschaft nicht in XAML verwenden.

Eigenschaftenwert

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 space key is pressed over the button.

This example shows how to use the IsPressed 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>

Microsoft .NET Framework 3.0 wird unter Windows Vista, Microsoft Windows XP SP2 und Windows Server 2003 SP1 unterstützt.

.NET Framework

Unterstützt in: 3.0
Anzeigen:
© 2014 Microsoft