Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Aug 2005
    Posts
    46
    Thanks
    0
    Thanked 0 Times in 0 Posts

    c# control handling

    Before I've been doing my codebehind in vb.net, but I'm wanting to migrate to C#. I'm not currently in a situation where I can test my pages (the stuff I need is in the mail), but I'm trying to write as much of the program I'm working on now so when I can test it I just have to work out bugs rather than start from scratch.

    In vb.net with your subs you put after the name and parameters Handles.button1, but in my research I'm not seeing anything that would correspond with Handles for C#. I just want to know how to let C# know that this is what needs to run when I click this button.

    Thanks for the help,

    Brett Bretterson

  • #2
    teh Moderatorinator
    Join Date
    Sep 2004
    Location
    USA
    Posts
    2,472
    Thanks
    4
    Thanked 40 Times in 40 Posts
    You add new event handler, slightly different than vb:

    this.Button1.Click += new System.EventHandler(this.Button1_Click);

    Button1_Click is what's going to be ran when you click the button.

    Good luck

  • #3
    New Coder
    Join Date
    Aug 2005
    Posts
    46
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks a lot,

    Brett Bretterson


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •