Export (0) Print
Expand All

Events Sample

This sample shows how to declare, invoke, and hook up to events in C#.

This sample contains the source code for the Events Tutorial.

Building and Running the Sample Within Visual Studio

To build and run the Events samples

  1. Open the solution (Events.sln).
  2. In Solution Explorer, right-click the Events1 project and click Set as StartUp Project.
  3. From the Debug menu, click Start Without Debugging.
  4. Repeat the preceding steps for Events2.

Building and Running the Sample from the Command Line

To build and run the Events samples

  1. Use the Change Directory command to change to the Events1 directory.
  2. Type the following:
    csc events1.cs
    events1
    
  3. Use the Change Directory command to change to the Events2 directory.
  4. Type the following:
    csc events2.cs
    events2
    

See Also

Events Tutorial | Tutorial Samples

Show:
© 2014 Microsoft