如何在vb.net的datagridview中的单元格/行中处理long press
?
我知道如何处理click
和double click
等事件。但我不知道如何处理long press
。
感谢任何帮助。
谢谢:)
答案 0 :(得分:2)
你应该在鼠标按下事件上启动一个计时器,在鼠标按下事件上停止它,然后得出结论:)
周咀:Private ClickTime As DateTime
Private Sub DataGridView1_MouseDown(sender As Object, e As MouseEventArgs) Handles DataGridView1.MouseDown
ClickTime = Now
End Sub
Private Sub DataGridView1_MouseUp(sender As Object, e As MouseEventArgs) Handles DataGridView1.MouseUp
If (Now - ClickTime).TotalMilliseconds > 500 Then MsgBox("LongClick")
End Sub