Generally, the time difference between two clicks is used to determine whether it is a double-click.
Systeminformation. doubleclicktime is 500 by default.
The first way: you can refer to the http://blog.csdn.net/zbssoft/article/details/5602658
Datetime lastdowntime = datetime. now;
Private Void Combobox#mousedown ( Object Sender, mouseeventargs E)
{
Timespan sp = datetime. Now-lastdowntime;
If (Sp. milliseconds <= systeminformation. doubleclicktime)
{
System. Console. writeline ( " DoubleClick " );
}
Else
{
System. Console. writeline ( " Click " );
}
Lastdowntime = datetime. now;
}
When a double-click event is triggered by the treelist control in derexpress, the click event is always triggered. To process the differentCode, Solution:
Method 2: http://www.devexpress.com/support/center/p/s136873.aspx. Remember that the interval attribute of the timer control is 500
Bool Needhandlemouseclick = True ;
Private Void Tldokumente_mouseclick ( Object Sender, mouseeventargs e ){
Timer1.start ();
}
Private Void Treelist1_mousedoubleclick (Object Sender, mouseeventargs e ){
Needhandlemouseclick = False ;
// Perform your code here
// ...
// System. Diagnostics. process. Start (File );
}
Private Void Timereffectick ( Object Sender, eventargs e ){
Timer1.stop ();
If (Needhandlemouseclick ){
// Your code here
// ...
// Wbdokument. navigate (File );
}
Needhandlemouseclick = True ;
}