List Info

Thread: Communicating with the MDIForom from a MDI Child of a Child




Communicating with the MDIForom from a MDI Child of a Child
country flaguser name
United States
2007-10-15 13:10:14

Greetings -

I want to send data and execute methods on an MDIForm from a
MDIChild-of-a-MDIChild WITHOUT having to include the MDIForm in the
uses clause of the MDIChild-of-a-MDIChild. For example, how can I do
the following:

An MDIForm has a method named SetTable. This method stores the name
of a table in a public variable named CurrentTable.

Another form, MDIChild2, is a descendant of MDIChild1. I'd like to
set the variable CurrentTable found in MDIForm from MDIChild2. I know
that I can include the MDIForm in the uses clause of MDIChild2. But,
I'm curious how to do this using an object-oriented call.

MDIChild2 --> MDIChild1 --> MDIForm(CurrentTable)

Thanks in advance for your help

Ken

__._,_.___
.

__,_._,___
Re: Communicating with the MDIForom from a MDI Child of a Child
country flaguser name
United States
2007-10-15 13:29:29

kenhaile wrote:
> I want to send data and execute methods on an MDIForm from a
> MDIChild-of-a-MDIChild

MDI children cannot have MDI children of their own.

There can be only one MDI parent form in an application. All MDI children
in a program are necessarily children of that one MDI parent.

> WITHOUT having to include the MDIForm in the
> uses clause of the MDIChild-of-a-MDIChild.

Why?

>; For example, how can I do the following:
>
> An MDIForm has a method named SetTable. This method stores the name
>; of a table in a public variable named CurrentTable.
>
> Another form, MDIChild2, is a descendant of MDIChild1. I'd like to
> set the variable CurrentTable found in MDIForm from MDIChild2. I know
>; that I can include the MDIForm in the uses clause of MDIChild2. But,
>; I'm curious how to do this using an object-oriented call.

(Application.MainForm as TMDIForm).SetTable(x);

See the objects? That is object oriented.

To do that, you'll need to include the TMDIForm class's unit in one of the
calling unit's "uses" clauses.

> MDIChild2 --> MDIChild1 --> MDIForm(CurrentTable)
>
> Thanks in advance for your help

--
Rob

__._,_.___
.

__,_._,___
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )