Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. C# events list problem

C# events list problem

Scheduled Pinned Locked Moved C#
csharphelpquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sheel Gohe
    wrote on last edited by
    #1

    My problem is, i have migrated from VB.net to C# recently. In vb.net, in the code window's left combo box we get the list of controls and in the right combobox we get the list of events associated with the selected control in the left combobox. And when we select an event from the combobox list vb.net writes the declaration for that event. But in C# i am finding difficulty in writing events by my own. I know how can we add events in C#, like, we have to go to windows designer code and write a new eventhandler like : this.button1.KeyDown += new System.EventHandler(this.button1_KeyDown); and then i have to go to my forms code window (i m using .net 2005) and write a method there with name "button1_Keydown". But my problem is i dont know what arguments i have to pass in this method. In vb.net the designer itself write the method with arguments for me so i dont have to worry about what are the event's arguments. Please help me how can i get the list of events with its arguments associated with a controls. Thansks in advance:). sheel

    L 1 Reply Last reply
    0
    • S Sheel Gohe

      My problem is, i have migrated from VB.net to C# recently. In vb.net, in the code window's left combo box we get the list of controls and in the right combobox we get the list of events associated with the selected control in the left combobox. And when we select an event from the combobox list vb.net writes the declaration for that event. But in C# i am finding difficulty in writing events by my own. I know how can we add events in C#, like, we have to go to windows designer code and write a new eventhandler like : this.button1.KeyDown += new System.EventHandler(this.button1_KeyDown); and then i have to go to my forms code window (i m using .net 2005) and write a method there with name "button1_Keydown". But my problem is i dont know what arguments i have to pass in this method. In vb.net the designer itself write the method with arguments for me so i dont have to worry about what are the event's arguments. Please help me how can i get the list of events with its arguments associated with a controls. Thansks in advance:). sheel

      L Offline
      L Offline
      lmoelleb
      wrote on last edited by
      #2

      In the designer select the control you want an event for. In the property grid switch to "events" and double click the event you want to implement.

      S M 2 Replies Last reply
      0
      • L lmoelleb

        In the designer select the control you want an event for. In the property grid switch to "events" and double click the event you want to implement.

        S Offline
        S Offline
        Sheel Gohe
        wrote on last edited by
        #3

        Many thanks to you my friend. You solved my big problem. Happy Coding:-D Sheel sheel

        1 Reply Last reply
        0
        • L lmoelleb

          In the designer select the control you want an event for. In the property grid switch to "events" and double click the event you want to implement.

          M Offline
          M Offline
          malharone
          wrote on last edited by
          #4

          Though personally i think this approach is perfect (and i admit using it often)... but I'd hate to rely on the UI designer for the control events and such. Most of the times, for the sake of clealiness, I myself associate the events manually. And the C# IDE has a great intellisense for events. As soon as you type "MyControl.Event+=" .. simply press "Tab" twice and it'll do the job. - Malhar

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups