ClickMode Enumeration
TOC
Collapse the table of content
Expand the table of content

ClickMode Enumeration

 

Specifies when the Click event should be raised.

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

public enum class ClickMode

Member nameDescription
Hover

Specifies that the Click event should be raised when the mouse hovers over a control.

Press

Specifies that the Click event should be raised as soon as a button is pressed.

Release

Specifies that the Click event should be raised when a button is pressed and released.

The following example shows three buttons that respond to clicks in three different ways.

  • Hover - the first button changes colors when the user hovers with the mouse over the button.

  • Press - the second button requires that the mouse be pressed while the mouse pointer is in the button.

  • Release - the third button does not reset the background color of the buttons until the mouse is pressed and released in the button.

<Button Name="btn1" Background="Pink" 
        BorderBrush="Black" BorderThickness="1" 
        Click="OnClick1" ClickMode="Hover">
  ClickMe1
</Button>

<Button Name="btn2" Background="LightBlue" 
        BorderBrush="Black" BorderThickness="1" 
        Click="OnClick2" ClickMode="Press">
  ClickMe2
</Button>

<Button Name="btn3" 
        Click="OnClick3" ClickMode="Release">
  Reset
</Button>
No code example is currently available or this language may not be supported.

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