How can I detect that the button in my application is still clicked (down)? and how to know when it is released?
+3
A:
Try using the MouseDown and MouseUp events
Example:
XAML:
<Button x:Name="Button1" MouseDown="OnMouseDown" Content="Button1" />
Code behind:
private void OnMouseDown(object sender, MouseButtonEventArgs e)
{
//do something
}
Same goes for MouseUp
Darko Z
2010-07-06 01:19:06
@Darko Z: any example?
sikas
2010-07-06 01:22:31
theres also more information in the links
Darko Z
2010-07-06 01:34:14
+4
A:
Are you looking for RepeatButton? It's one of the built-in WPF button controls, and it raises its Click event repeatedly if you press and hold the button. It's used internally to implement things like the "up-arrow" and "down-arrow" buttons on a scrollbar.
Joe White
2010-07-06 01:54:09