Convert Event from C# to VB.Net

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Husam

    #1

    Convert Event from C# to VB.Net

    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 ReadyStateCompl ete {
    add {
    Events.AddHandl er(_readyStateC ompleteEvent, value);
    }
    remove {
    Events.RemoveHa ndler(_readySta teCompleteEvent , value);
    }
    }
    any help will be completlly appreciated

    regard's

    Husam
  • Carlos J. Quintero [VB MVP]

    #2
    Re: Convert Event from C# to VB.Net

    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 ReadyStateCompl ete As EventHandler

    AddHandler(ByVa l value As EventHandler)
    ...
    End AddHandler

    RemoveHandler(B yVal value As EventHandler)
    ...
    End RemoveHandler

    RaiseEvent(ByVa l sender As Object, ByVal e As System.EventArg s)
    ...
    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:
    MZ-Tools has a single goal: To make your everyday programming life easier. As an add-in to several Integrated Development Environment (IDEs) from Microsoft, MZ-Tools adds new menus and toolbars to them that provide many new productivity features.




    "Husam" <Husam@discussi ons.microsoft.c om> escribió en el mensaje
    news:6429B9E2-2705-4A36-8080-5A1254567600@mi crosoft.com...[color=blue]
    > 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 ReadyStateCompl ete {
    > add {
    > Events.AddHandl er(_readyStateC ompleteEvent, value);
    > }
    > remove {
    > Events.RemoveHa ndler(_readySta teCompleteEvent , value);
    > }
    > }
    > any help will be completlly appreciated
    >
    > regard's
    >
    > Husam[/color]


    Comment

    Working...