Trong Class mình có các phương thức:
Trong Form mình gọi phương thức thì bị lỗi, bạn nào biết xin chỉ giúp!
Mã:
Public Event ImageUpdate As ImageUpdateHandler
Public Delegate Sub ImageUpdateHandler(ByVal sender As Object, ByVal e As ImageUpdateEventArgs)
Public Class ImageUpdateEventArgs
Inherits EventArgs
Private _image As Image
Public ReadOnly Property Image As Image
Get
Return _image
End Get
End Property
Public Sub New(ByVal i As Image)
_image = i
End Sub
End Class
Mã:
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
_radar = New Radar(PictureBox1.Width)
_radar.numberOfSpirals = 3
PictureBox1.Image = _radar.Image
AddHandler _radar.ImageUpdate, New ImageUpdateHandler((AddressOf Me._radar_ImageUpdate))
_radar.DrawScanInterval = speed
End Sub
Private Sub _radar_ImageUpdate(ByVal sender As Object, ByVal e As ImageUpdateEventArgs)
PictureBox1.Image = e.Image
End Sub