Solved

Control the MDI parent from within the child

Posted on 2002-03-23
3
195 Views
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?

Thanks,
JDN
0
Comment
Question by:JDN
3 Comments
 
LVL 9

Accepted Solution

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


implementation
uses
  MainFormUnit;  

-----
Igor.


0
 
LVL 4

Expert Comment

by:jsweby
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.

J.
0
 
LVL 1

Author Comment

by:JDN
ID: 6892093
OK, thanks. This works fine!
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

685 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