invoking an event using a delegate

G

Guest

Hello,
I would like to invoke an event using a delegate or any other way.

I have declared a delegate as below with the same signature as the event I
wish to invoke.

Delegate Sub DelGroupClicked(ByVal sender As Object, ByVal e As
GroupClickedEventArgs)

/* Below is the code that that I have used to invoke an instance of the
delegate */

My question is
Dim Del1 As DelGroupClicked
Del1 = New Delgroupclicked(AddressOf ListBarGroupClick)
/* below I would like to invoke the click event of a 'list bar' so that
It would be as if I had manually clicked the listbar
Del1.Invoke(???)


/* event that I wish to invoke */

Public Shared Sub ListBarGroupClick(ByVal sender As Object, ByVal e As
GroupClickedEventArgs) Handles ListBar1.GroupClicked
If e.Group.Caption = "Projects" Then
/code left out for succinctness
End If

End Sub

Any help would be greatly appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top