Try
Dim lb1 As WinForm.Label = e.Form.Controls("Label1")
Dim iRetCOM As Integer
For iPort As Integer = 1 To 16 '遍历端口号
iRetCOM = CVR_InitComm(iPort)
If iRetCOM = 1 Then
Exit For
End If
Next
If iRetCOM = 1 Then
lb1.Text = "设备连接成功"
Else
lb1.Text = "设备连接失败"
e.Form.TimerEnabled = False '停止计时器,使得自动读取功能失效
e.Form.Controls("Button1").Enabled = False '禁用读卡按钮
e.Form.Controls("CheckBox1").Enabled = False '禁用自动读取复选框
End If
Catch ex As Exception
MessageBox.Show(ex.ToString)
End Try
报错:Form不是e的成员