We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Catch events arrived from another object

Thread ID:

Created:

Updated:

Platform:

Replies:

5415 Jul 2,2003 12:51 AM Jul 9,2003 03:53 AM Windows Forms 1
loading
Tags: FAQ
Tigran
Asked On July 2, 2003 12:51 AM

How can I catch events of the object if do like ,f.e: class MyClass{ Event1(); Event2(); ..... } After declaration of MyClass write anywhere in the Main function public static void Main(){ MyClass c = new MyClass(); MyClass c_new; c_new = c; //????? /*After this catch events which arrive to object 'c' in the object 'c_new' How can I do this, if this is possible in general?*/ }

Ramesh Praveen [Syncfusion]
Replied On July 9, 2003 03:53 AM

Actually c and c_new are referring to the same object. And to listen to events fired by this object, you do this: c.Event1 += new EventHandler(this.MyHandler); //Also define MyHandler in your class: private void MyHandler(object sender, EventArgs e) { ... } -Praveen

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;