Home > Net >  WPF double-click events don't detours
WPF double-click events don't detours

Time:04-15

Private void MouseLeftButtonDown (object sender, MouseButtonEventArgs e)
{
The switch (e.c. with our fabrication: lickCount)
{
Case 1://click
{
NativeMethods. SendMessage (Hwnd, (int) WindowMessages WM_NCLBUTTONDOWN, (IntPtr) HitTest. HTCAPTION, IntPtr. Zero).
break;
}
Case 2://double-click
{
WindowState=WindowState==WindowState. Maximized? WindowState. Normal: WindowState. Maximized;
break;
}
}

}

CodePudding user response:

Lz, sharing, learning, although didn't do any WPF

CodePudding user response:

You this is drag form any part of the mobile forms of code, do you want to do

CodePudding user response:

What detours this is

CodePudding user response:

CodePudding user response:

Double-click the triggers before click, double-click the events triggered by MouseDoubleClick or PreviewMouseDoubleClick,

CodePudding user response:

Log in CSDN, specially came to give you some praise

CodePudding user response:

Didn't quite understand the original poster to express the content of the general controls provide, DoubleClick events can not provide custom rules by clicking on the event, click twice time interval, the distance to simulate the effect of the double click event, such as

CodePudding user response:

The original and the operation? The original directly determine the lickCount of e.c. with our fabrication: ok...
Before in order to achieve the textblock simulation double-click events, events with the commonly used the online judge interval method,
According to the method of the building Lord, I direct the if (e.c. with our fabrication: lickCount==2) {MessageBox. Show (" double-click event has achieved!" )} is finished!
I am very terrible ignorance...

CodePudding user response:

Use clickcount==2 judgment or will conflict you do WPF or experience too little
  •  Tags:  
  • C#
  • Related