Solved

Accessing components on a MDI form....

Posted on 1997-09-30
1
150 Views
Last Modified: 2010-04-04
I'm trying to add items to a list box which is on a MDI child form from other areas in the code..

I tried to use this code:

FrmMain.ActiveMDIChild.Listbox.Items.Add( ' Test');

where FrmMain is the parent form of the MDI form.

the code says that it expects a 'Field Identifier' after
ActiveMDIChild.

I am also only using version 1 of delphi.

How can I add to the listbox which is on a MDI form from anywhere in my code and not just in the file it was declared in?

Thanks for you help...
0
Comment
Question by:rowen
1 Comment
 
LVL 5

Accepted Solution

by:
JimBob091197 earned 60 total points
Comment Utility
The reason is that the ActiveMDIChild property doesn't have a property called ListBox, so you have to cast the ActiveMDIChild property to the type of your MDI child form, e.g.:

TMyMDIChild(frmMain.ActiveMDIChild).ListBox.Items.Add('Test');

I presume Delphi 1 would allow you to type-cast like this.  (I use Delphi 3.)

0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

771 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now