How can I catch both single-click and double-click events on WPF FrameworkElement?

后端 未结 9 1513
鱼传尺愫
鱼传尺愫 2020-12-15 06:21

I can catch a single-click on a TextBlock like this:

private void TextBlock_MouseDown(object sender, MouseButtonEventArgs e)
{
    MessageBo         


        
9条回答
  •  清歌不尽
    2020-12-15 06:41

    You could do it on MouseUp instead of MouseDown. That way you can ask the ClickCount property for the total number of clicks, and decide what to do from that point.

提交回复
热议问题