Convert Event from C# to VB.Net

G

Guest

Hi EveryBody:

I have the following event written by C# And I want some body help me or
advise me in how can I write it in Vb.Net, also if there is any refreance
that I have to add please tell me :

public event EventHandler ReadyStateComplete {
add {
Events.AddHandler(_readyStateCompleteEvent, value);
}
remove {
Events.RemoveHandler(_readyStateCompleteEvent, value);
}
}
any help will be completlly appreciated

regard's

Husam
 
C

Carlos J. Quintero [VB MVP]

Hi Husam,

VB.NET 2002/2003 does not support custom events but VB.NET 2005 does, so
check the help docs about "Custom Event":

Public Custom Event ReadyStateComplete As EventHandler

AddHandler(ByVal value As EventHandler)
...
End AddHandler

RemoveHandler(ByVal value As EventHandler)
...
End RemoveHandler

RaiseEvent(ByVal sender As Object, ByVal e As System.EventArgs)
...
End RaiseEvent

End Event

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio
You can code, design and document much faster:
http://www.mztools.com
 

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