Hi guys,
Here's my basic code, i'm trying to create a timer and add a handler to the timer that calls the form's paint sub.
I get the following error for the "Me.Paint" part of the AddHandler method:
'AddressOf' operand must be the name of a method; no
parentheses are needed.
I read in a forum somewhere else that AddressOf cannot call a sub with args?
Any idea?
Here's my basic code, i'm trying to create a timer and add a handler to the timer that calls the form's paint sub.
VB.NET:
Public Class Form1
Dim t As New System.Timers.Timer(500)
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
AddHandler t.Elapsed, AddressOf Me.Paint
End Sub
Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
'do something
End Sub
End Class
I get the following error for the "Me.Paint" part of the AddHandler method:
'AddressOf' operand must be the name of a method; no
parentheses are needed.
I read in a forum somewhere else that AddressOf cannot call a sub with args?
Any idea?