delegate problem in translate from c#

I

is_vlb50

I have problem with translate next code from c# to vb :


private UStateEventHandler _myUStateEventHandler;

//where UStateEventHandler is defined as :
//public sealed delegate UStateEventHandler : System.MulticastDelegate


// Create the event handlers we need.
_myUStateEventHandler = _obj1.CreateEventHandler(new
UStateEventHandler(OnUserStateChange));

// Add the event handlers to the session-global events.
obj1.UStateChanged += _myUStateEventHandler;

//where UStateChanged defined in class library as:
//public abstract new event UStateEventHandler UStateChanged

How I can translate to vb +- ?
Thanks
 
C

Cor Ligthert[MVP]

Hi,

Have a look where the instanced class that is about this
_myUStateEventHandler

Then declare it globaly "WithEvents" (this does not exist in C#)

Then put at the end of the method that is handled handles.blabla

Probably the most simple

Cor
 

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