2

Hello I'm having a problem with my button. When I click it, the button's not firing the method:

  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

What am I missing in here?

4

3 回答 3

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 是一个有点不同的解决方案。

于 2013-05-08T16:48:59.557 回答
1
  1. 转到表单设计器。
  2. 选择按钮。
  3. 在属性窗格中,默认情况下右下角,单击“闪电”图标。
  4. 找到“点击”条目。
  5. 单击右侧的小下拉箭头并选择“button1_click”。

处理程序现在应该再次与您的按钮单击事件相关联。

于 2013-05-08T16:56:47.463 回答
0

像这样更改声明:

Private Sub button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
于 2013-05-08T16:48:51.833 回答