Click here to Skip to main content
15,888,351 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I had created one user control and one class file, The user control contain save button. When user click save button then i want to pass parent form name of user control as parameter. and access the function from class file please help me.
Posted
Comments
Nasir M@hmood 26-Mar-13 2:14am    
Post your code.

1 solution

The term "call" is not applicable to events. Event instances are invoked, which is a very different, more complex notion; all of the event handlers added to an event list of some event instance are called. And it is impossible to invoke an event instance from anywhere except the method of a declaring class. This is a special fool-proof feature of events, in contrast to "regular" delegate instances.

That was the answer to the question title. As to the question body, it looks unrelated to the title. First of all, form names don't play any essential role except their use in designer. You should better pass a form itself, as you have its reference. You don't explain where do you want to pass something and why, so the question is not clear. But! — you don't need to pass it anywhere, because you have Control.Parent and Control.FindForm:
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.aspx[^].

—SA
 
Share this answer
 

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