Add event through IDE (VS2008 C#)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ShadowLocke
    New Member
    • Jan 2008
    • 116

    Add event through IDE (VS2008 C#)

    This may be a silly question, but how can one add an event through the IDE?

    i.e. I place a button on the form design time..double click it automatically adds the click event for me. How do I add another event say..VisibleCha nged?

    Usually I would edit Form1.Designer. cs myself, but for less experienced programmers it could get a little confusing (i.e. VS would overwrite changes if not done properly)
  • ShadowLocke
    New Member
    • Jan 2008
    • 116

    #2
    Ah..i found it

    Learn how to subscribe to and unsubscribe from events. Subscribe to events using the Visual Studio IDE, programmatically, or using an anonymous method.

    Comment

    • Plater
      Recognized Expert Expert
      • Apr 2007
      • 7872

      #3
      Could you not just look at the events list in the properties section of the selected control?

      Comment

      • Frinavale
        Recognized Expert Expert
        • Oct 2006
        • 9749

        #4
        Originally posted by Plater
        Could you not just look at the events list in the properties section of the selected control?
        How do you do this?

        I was going a little crazy the other day when I tried doing this in a C# project....the events were not listed for the controls.

        Comment

        • Plater
          Recognized Expert Expert
          • Apr 2007
          • 7872

          #5
          Sure they are? Select your control and go the proeprties window (Mine is anchored on the right hand side, yours could be anywere)
          And then Click the lightening bolt to see the events. Same as the old VB was?

          Comment

          • Frinavale
            Recognized Expert Expert
            • Oct 2006
            • 9749

            #6
            Oh in the Designer View?!
            I'll have to try that later...thanks

            Comment

            • ShadowLocke
              New Member
              • Jan 2008
              • 116

              #7
              Originally posted by Plater
              Could you not just look at the events list in the properties section of the selected control?
              Thats exactly what i was looking for. Lol..i felt crazy that i couldnt find it. The site mentioned above shows exactly that.

              Comment

              • 2euge
                New Member
                • May 2009
                • 1

                #8
                add an event

                Save, compile and add

                Comment

                Working...