您好我的按钮有问题。当我点击它时,按钮没有触发方法:
Private Sub button1_Click(sender As System.Object, e As System.EventArgs)
'Initialize the capture device
grabber = New Capture()
grabber.QueryFrame()
'Initialize the FrameGraber event
AddHandler Application.Idle, New EventHandler(AddressOf FrameGrabber)
button1.Enabled = False
End Sub
我在这里想念的是什么?
答案 0 :(得分:3)
应该有像
这样的东西Private Sub button1_Click(sender As System.Object, e As System.EventArgs) Handles button1.Click
或
AddHandler button1.Click, AddressOf button1_Click
我想它的vb.net和winforms。使用VB6或WPF是一个有点不同的解决方案。
答案 1 :(得分:1)
处理程序现在应该再次与您的按钮点击事件相关联。
答案 2 :(得分:0)
像这样更改声明:
Private Sub button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click