Advertisement

07.10.2008 at 01:24PM PDT, ID: 23555335
[x]
Attachment Details

how to set up an event delegate in one form and use in another form

Asked by eugene-g in Microsoft Visual C#.Net, .Net Editors & IDEs

Tags: C# .NET WinForms

C# - .NET WinForms
In my example there are 2 objects: the MainForm, which has a custom control "control1" in it, and a UserControl "control2" that becomes a child of the MainForm.
I need to be able to respond to the click event of the control1 from within control2.
For some reason I'm unable to obtain a reference to control1 in the control2, so I'm thinking of declaring a method delegate in the MainForm (which does have visibility to the control1) and then, use that delegate in the control2. I hope, this way when the control1 is clicked the MainForm can raise the event and control2 can resplond to it.Start Free Trial
 
Loading Advertisement...
 
[+][-]07.10.2008 at 02:23PM PDT, ID: 21977529

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.10.2008 at 03:24PM PDT, ID: 21977891

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.10.2008 at 03:27PM PDT, ID: 21977908

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.10.2008 at 03:52PM PDT, ID: 21978060

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.10.2008 at 04:11PM PDT, ID: 21978181

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.10.2008 at 04:13PM PDT, ID: 21978204

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Visual C#.Net, .Net Editors & IDEs
Tags: C# .NET WinForms
Sign Up Now!
Solution Provided By: DarkoLord
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628