简体   繁体   中英

Control to get back from Eventhandler to original location in C#

In a method i called an event handler say MyButton.PerformClick() . At runtime, After executing the functionality of button click MyButton_CLick(object Sender, EventArgs e) , the execution pointer is not come back to the Event calling point location to perform execution in the method down-line. Is there a way to return the control from event handler to the method calling point?

Provide me with code in C#.

They way events work, the only way you can achieve what you want is by calling event handler directly (which is not a good practice!)

MyButton_CLick(null, EventArgs.Empty)

instead of

 MyButton.PerformClick()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM