Hi all,
I have created in code a visible control and i am trying to apply an on_click event to it with no success my code is
and the error i am getting is
Handles clause requires a WithEvents variable defined in the containing type or one of its base types
Handles itmTemp.Click
Any thoughts cause i am completely stuck!
Thnx
I have created in code a visible control and i am trying to apply an on_click event to it with no success my code is
Code:
Public Sub createItem(ByVal itmName As String, ByVal itmImagePath As String, ByVal itmParent As XPExplorerBar.Expando)
Dim itmTemp As New XPExplorerBar.TaskItem
itmTemp.Name = itmName
itmTemp.Text = itmName
Dim tmpImage As System.Drawing.Image = System.Drawing.Image.FromFile(itmImagePath)
itmTemp.Image = tmpImage
itmParent.Items.Add(itmTemp)
End Sub
Private Sub itmTemp_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles itmTemp.Click
'do something
end sub
and the error i am getting is
Handles clause requires a WithEvents variable defined in the containing type or one of its base types
Handles itmTemp.Click
Any thoughts cause i am completely stuck!
Thnx