本文介绍了如何检查点击是否为Performclick的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好,我需要检查按钮单击是否为performclick.就像是if(click是button1.performclick()){做一点事 }别的{做某事}
Hi i have a requirement to check for a button click is a performclick or not .some thing likeif(click is button1.performclick()){do something }else{do something }
有谁能帮忙
推荐答案
检查Click事件的事件参数.
Check the event args of the Click event.
单击按钮本身时;事件args包含鼠标的坐标.执行PerformClick时;事件args为空.
When you click the button itself; the event args contain the coordinates of the mouse.When PerformClick was executed; the event args are empty.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If e.Equals(EventArgs.Empty) Then
' Performclick
Else
' Normal click
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Button1.PerformClick()
End Sub
这篇关于如何检查点击是否为Performclick的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!