Control the MDI parent from within the child

Posted on 2002-03-23
Medium Priority
Last Modified: 2010-04-05
Hi experts,

I'm writing a MDI application with one main MDI form and several MDI childs. What I like to do is to access components on the main form from within the MDI child. For example: when the user enters some data in a MDI child form, I want to display some labels on the main form or put some text in the statusbar, which also resides on the main form.
I cannot simply define the main form in the uses-clause of the child because the child is already in the uses-clause of the main form, therefore a cross reference error is reported by the compiler.

Can anyone tell me how to do this?

Question by:JDN

Accepted Solution

ITugay earned 150 total points
ID: 6890591
specify MDI form bellow "implementation"




Expert Comment

ID: 6890615
ITugay is right. Don't put the main form in the uses clause at the top of the form, add a new uses clause in the implementation section of the unit and reference the main form in there.

In fact, if you just reference the main form in your code, when you compile you application, Delphi will ask you if you want to put the main form's unit in the uses clause.


Author Comment

ID: 6892093
OK, thanks. This works fine!

Featured Post

Train for your Pen Testing Engineer Certification

Enroll today in this bundle of courses to gain experience in the logistics of pen testing, Linux fundamentals, vulnerability assessments, detecting live systems, and more! This series, valued at $3,000, is free for Premium members, Team Accounts, and Qualified Experts.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Planning to migrate your EDB file(s) to a new or an existing Outlook PST file? This video will guide you how to convert EDB file(s) to PST. Besides this, it also describes, how one can easily search any item(s) from multiple folders or mailboxes…
Watch the video to know the simple way to remove or recover or reset lost or forgotten passwords of Outlook PST file. With Kernel Outlook Password Recovery tool such operation is very easy to perform. It is a freeware with limitation to use with 500…

600 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