Private Sub AddToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AddToolStripMenuItem.Click
Dim numbers() As Integer = {myarray(x)}
Dim element As Integer
Dim total As Integer
For Each element In numbers
total = total + element
Next element
End Sub
This is the code I have for adding the numbers in an array, but I keep getting an error that pertains to the top line that says "Handles clause requires a WithEvents variable defined in the containing type or one of it's base types". The words "AddToolStripMenuItem" are underlined. How can I fix this?
This is an assignment for school and I really need help!