Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

MDI Forms

Posted on 2003-12-08
2
Medium Priority
?
630 Views
Last Modified: 2010-04-16
I have an MDI application.

When my parent opens a child form I am able to hook into the close event of the child form in my parent's code as follows:

          private void File_New_Click(object sender, System.EventArgs e)
          {
               NewPartitionForm1 objForm = new NewPartitionForm1();

               objForm.MdiParent = this;

               objForm.Closing += new CancelEventHandler(Form1_Closed);

               objForm.Show();
          }

How can I hook into events such as click events of buttons on my child though?

Thanks

Dave
0
Comment
Question by:daveamour
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 20

Accepted Solution

by:
TheAvenger earned 100 total points
ID: 9899918
objForm.MyButton.Click += new EventHandler (...);

but the MyButton should be a public variable or a public property that exposes the button. The other way is to make a public method of your control to receive the delegate and attach it to the control.
0
 
LVL 19

Author Comment

by:daveamour
ID: 9902752
Thanks, this works great.  Weird thing is I suspected this is how it works - ie make the button public which I'm sure I tried yesterday but it didn't work?  Oh well must have done something silly.

Thanks

Dave
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question