Solved

Accessing components on a MDI form....

Posted on 1997-09-30
1
156 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 5

Accepted Solution

by:
JimBob091197 earned 60 total points
ID: 1346642
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

705 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