Suppose name of button is button1
then we need to do as folllowing
button1.PerformClick();
this will execute code under click event of button1
How To get code to be execute of button click in runtime anywhere
Some times we need code to executed under button click on some paricular condition or in some method after specific condition this can be done as follows


Join the conversation! Your thoughts help the community grow.