converting vb.net to c# help

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

    converting vb.net to c# help

    I am trying to convert this piece of code to c# from
    vb.net. Does anyone have any ideas?

    Private Sub Page_Load(ByVal sender As System.Object, ByVal
    e As System.EventArg s) Handles MyBase.Load

  • Nicholas Paldino [.NET/C# MVP]

    #2
    Re: converting vb.net to c# help

    Steve,

    You can do this:

    private void Page_Load(objec t sender, EventArgs e)

    However, that is only part of it. You will have to create the delegate
    and assign the method, like this:

    Load += new EventHandler(th is.Page_Load);

    This should be done in the InitializeCompo nent method on your Page class
    (if the designer was the one that created it).

    Hope this helps.


    --
    - Nicholas Paldino [.NET/C# MVP]
    - mvp@spam.guard. caspershouse.co m

    "Steve" <sbabaz@bellsou th.net> wrote in message
    news:103e501c3b e71$936c3530$a6 01280a@phx.gbl. ..[color=blue]
    > I am trying to convert this piece of code to c# from
    > vb.net. Does anyone have any ideas?
    >
    > Private Sub Page_Load(ByVal sender As System.Object, ByVal
    > e As System.EventArg s) Handles MyBase.Load
    >[/color]


    Comment

    Working...