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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Catch events arrived from another object

Thread ID:





5415 Jul 2,2003 04:51 AM UTC Jul 9,2003 07:53 AM UTC WinForms 1
Tags: FAQ
Asked On July 2, 2003 04:51 AM UTC

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 07:53 AM UTC

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


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon