Home > Net >  WPF distinguish click and double click on the events in the problem of conflict
WPF distinguish click and double click on the events in the problem of conflict

Time:04-15

WPF distinguish click and double click on the events in the problem of conflict

CodePudding user response:

Said a Clickcount property click the number of times you can query,

CodePudding user response:

Double click and click the conflict is mainly double-click may trigger when click operation, the usual solution is to click on the define a Timer when the Timer, after receiving the click event message waiting for some time, if the waiting time again receive the click event, so is considered a double-click events, and close the Timer, if at the end of the waiting time Timer didn't accept to the click event, argues that the time for the click event, close the Timer and execute click operation,
This method has a disadvantage is that if the click event, not immediately be accordingly, need to wait for a certain events to determine whether there is a second click, so wait for the time shoulds not be too long, but the waiting time is too short, or double-click the will is considered to be click twice, after testing, the waiting time is about on general Windows 350 ms to 500 ms,

CodePudding user response:

Do not know to have event bubbling the plan

CodePudding user response:

WPF inside can distinguish between directly, without writing other code

CodePudding user response:

can't distinguish between is too young

CodePudding user response:

The problem is how to? I wonder, write the.net incredibly still can encounter this problem,
  •  Tags:  
  • C#
  • Related