ironfistchamp
Active member
- Joined
- Dec 9, 2005
- Messages
- 29
- Programming Experience
- Beginner
I am creating a small program that uses a timer to check a statement every 5 seconds and calls a sub if it is true.
I have that bit working fine it is just that I get the error message "Error 1 Handles clause requires a WithEvents variable defined in the containing type or one of its base types. " when I try to debug it. The timer is called timer1 and I got the code from the MSDN support database.
When I tried to create the program they had (absolutely identically) I have the same error message.
"Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick "
It is on that line of code and the underlined bit is the Timer1 from Timer1.Tick at the end.
Can someone help be sort this please.
Thanks very much
Ironfistchamp
I have that bit working fine it is just that I get the error message "Error 1 Handles clause requires a WithEvents variable defined in the containing type or one of its base types. " when I try to debug it. The timer is called timer1 and I got the code from the MSDN support database.
When I tried to create the program they had (absolutely identically) I have the same error message.
"Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick "
It is on that line of code and the underlined bit is the Timer1 from Timer1.Tick at the end.
Can someone help be sort this please.
Thanks very much
Ironfistchamp