المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Trigger a Parent Form Event From UserControl In TableLayoutPanel



C# Programming
07-14-2010, 03:53 AM
Howdy,

Thanks for looking into this.

I have a single form application.
The Main Form has a TableLayoutPanel.
When a user clicks a button on the main form, a UserControl is added to the controls in the TableLayoutPanel.
The UserControl has a button on it.

What I'd like to happen:
When the button on the UserControl is clicked, I want the Main Form to perform a method.

How do I get the Main Form to listen to an event on a Button on the UserControl?

Note: I need to see some code in the answer. I've read about delegates and such, but I'm not getting something. If I see it in code, I think I would understand.

Thanks in advance http://www.barakasoft.com/script/Forums/Images/smiley_smile.gif

Jess