How to pass button event from form1 to form 2

I had view your post to pass value from form 1 to form 2. Then what about passing button event from form1 to form2?
Posted by simtecha 9/24/2014 8:10:23 AM
Total Answers : 1
Answer 1
Yes you can use variables, controls and events of one form into another. You just have to make them public and use them as you want..

Do the following things....

Form1
---------
Make the button Click event button1_Click of the Form1 as public.

Form2
-------

Form1 f = new Form1();
f.button1_Click(sender, e);

That's It..

Enjoy and Keep in touch with Stepcoder.
Posted by StepCoder Team 9/28/2014 10:14:44 PM
Post your answer
Preview
Sign in to your account
Your Email : 
Password :   
Forgot your password
Don't have StepCoder account ?
Create a new account
 
Follow me on twitter
About Me
Harpreet Singh
I began programming with C++ when i was 17. Then at the middle of my study .NET came. Then I began to read C# and VB.NET. By the time i learnt SQL and ASP.NET, and developed some websites such as news portals that are active now. Currently i am running my own Software company.
Answer these questions! If you know the answer.