Accessing MDI child controls under MDI application
-
Hi, I want to build a MDI application. The workspace of my application (MDI child) has some controls inside of it. In the mean while i want to be able to controls such components in my main application code. How can i do it if they arent instantiated? Thx, Nuno
-
Hi, I want to build a MDI application. The workspace of my application (MDI child) has some controls inside of it. In the mean while i want to be able to controls such components in my main application code. How can i do it if they arent instantiated? Thx, Nuno
I don't think it would be a good idea to Access Form controls from outside the form. One of the approach you can take is define public functions in the child forms and call these from the MDI Parent.
-
I don't think it would be a good idea to Access Form controls from outside the form. One of the approach you can take is define public functions in the child forms and call these from the MDI Parent.
Ok. Thx!
-
Hi, I want to build a MDI application. The workspace of my application (MDI child) has some controls inside of it. In the mean while i want to be able to controls such components in my main application code. How can i do it if they arent instantiated? Thx, Nuno
Can I suggest that you take a look at design patterns - specifically the MVC pattern. Have a read up on it, and see why this is not a good idea. More importantly, a good text on the MVC pattern will show you how to solve this issue in a better fashion. You don't want to couple up the logic in a main form so that it knows how to update/control the controls in a child form. That is the responsibility of the child form. All you need to do is tell the child form WHAT you want it to achieve, and let it work out how to do it.
Deja View - the feeling that you've seen this post before.