locked
How to Make my own Event ? RRS feed

  • Question

  • hi
    How to Make my own Event ?
    ex. somthing like event will up or down (in C#)

    thank's in advance
    Tuesday, November 24, 2009 1:48 PM

Answers

  • Hi,

    please provide more info in your questions.
    Simple event is like this:

    class Foo
    {
       public event EventHandler MyEvent ;

       // raise the event.
       void OnMyEvent()
       {
           if(MyEvent != null)
              MyEvent(this, <some param here>);
       }
    }

    -----------------------------------------------------------------------
    Best regards.

    Flexible Treeview - the most flexible treeview-listview-grid hybrid control for .NET!
    • Marked as answer by Jing0 Monday, November 30, 2009 6:14 AM
    Tuesday, November 24, 2009 3:26 PM