Accessing data on form in MDI

Please discuss general Delphi programming topics here.

Accessing data on form in MDI

Postby Himie » January 26th, 2010, 2:56 am

Hi
I am working on an application that has a number of forms and one of these forms has child forms in an MDI. It works OK in that it shows the child form(s) OK as part of the client area of the parent but when I attempt to write to the child form (to a Text Edit and / or a ComboBox in the child form) from the parent form or another form in the application it throws an 'Access violation at adress 00778EBD...' and cannot write to the text of the control. I have the form as part of the Implementation with Uses so as I understand it should see the form and be able to read from or write to it (something like 'ChildForm.TextEditLastname.Text := MainForm.TextEditLastname.Text' as part of the MainForm TextEdit change event). Does MDI make any difference to this (I would have thought not) or can anyone give me some clues whay this might not be able to communicate with the form (as other non MDI forms do communicate OK).
Thanks and best wishes
Himie
Himie
Member
Member
 
Posts: 2
Joined: January 26th, 2010, 2:02 am

Re: Accessing data on form in MDI

Postby Kambiz » January 26th, 2010, 5:39 pm

You should use either MDIChildren or ActiveMDIChild properties of the main form to access the child form.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Re: Accessing data on form in MDI

Postby Himie » January 27th, 2010, 9:15 pm

Thanks Kambiz - will give it a try

Ross
Himie
Member
Member
 
Posts: 2
Joined: January 26th, 2010, 2:02 am


Return to Delphi Programming

Who is online

Users browsing this forum: No registered users and 5 guests

cron