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

I want to change certain controls on the MDI form of my application from within my child form.

I have been able to shortlist the following two methods.

1. Casting the MDIPArent property of the child form into the MDIForm Type
2. Declaring an event and raising it within the child form.

Questions
- Is there any other better method of achieving my objective?
- Which of the above two methods are preferred, and why?

Thanks a ton in advance :)

Regards
Posted

You could also set up a global static class that contains an event that fires when a property is changedand handle that event in the desired form.
 
Share this answer
 
Comments
RebornDeveloper 16-Sep-10 13:54pm    
Reason for my vote of 5
Automatic vote of 5 for accepting answer.
IMO, if you want to have the parent change based on something in the child, you should raise an event in the child and pass the changed information in that event.
 
Share this answer
 
Comments
RebornDeveloper 16-Sep-10 13:54pm    
Reason for my vote of 5
Automatic vote of 5 for accepting 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