使用RaiseEvent语句引发事件VB.NET

时间:2012-05-31 05:21:02

标签: windows vb.net aforge raiseevent

我收到此错误:

  

错误1'公共事件NewFrame(发件人为对象,eventArgs为
     AForge.Video.NewFrameEventArgs)'是一个事件,不能直接调用      使用'RaiseEvent'语句引发事件      C:\ Users \ Jonathan \ Documents \ Visual Studio 2010 \ Projects \ Stream \ Stream \ Form1.vb
    9 9流

我的代码是:

Enter image description here

我如何解决这个问题?

1 个答案:

答案 0 :(得分:9)

不是VB buff,但我不认为你如何订阅VB中的事件。尝试:

Dim stream As New MJPEGStream("...")
AddHandler stream.NewFrame, AddressOf Me.video_NewFrame
...
相关问题