TabStrip控件如何响应鼠标双击事件
现在需要处理TabStrip的双击事件,就是需要在双击其中某一选项卡的时候将其删除,但是TabStrip控件没有双击事件的过程,本来是想设置一个timer记录两次点击的时间的,结果必须在两次点击的时间间隔有2秒左右的时候才能正确判断,各位有没有什么好的处理方法啊?救命哦
[解决办法]
Private Declare Function GetDoubleClickTime Lib "user32 " () As Long
Private Declare Function GetTickCount Lib "kernel32 " () As Long
Private Sub TabStrip1_Click()
Static nLastClickTime As Long
Dim t As Long, nDoubleClickTime As Long
nDoubleClickTime = GetDoubleClickTime()
t = GetTickCount()
If t - nLastClickTime <= nDoubleClickTime Then
TabStrip1.Tabs(1).Caption = "双击 "
Else
TabStrip1.Tabs(1) = "单击 "
End If
nLastClickTime = t
End Sub