Click here to Skip to main content
15,906,467 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hai..


How to call method in one Winform to another Winform using c#.net

EX

from1
.....

Getmethod();

....


I want to call same method in From2

form2
......

Getmethod();

....


Thanks&Reragds


venkat
Posted
Updated 30-Nov-10 21:39pm
v2

Or if GetMethod is static and public you can call it by Form2.GetMethod()
 
Share this answer
 
You need to have a reference to form2 in form1 (and Getmethod() in form 2 must be public).
 
Share this answer
 
First off all declare The GetMethod() in Form1 as public.Then create object of that Form1 and call the method where ever you want to call (Make sure k your GetMethod() is not a static method),else call directly bt Form1.GetMethod().
 
Share this answer
 
Comments
[no name] 21-May-14 7:49am    
Do you really think that he is still waiting for an answer after 4 years? Besides that, your solution does not provide any more help than the solutions already given.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900