?
Solved

Accessing components on a MDI form....

Posted on 1997-09-30
1
Medium Priority
?
157 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 240 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

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…
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…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses

765 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