I am using a mdi application. I have a parent form and two diffrent mdi childs. One child one i have a text box and i want to set the text of the textbox from the second mdi child form.
I am unable to get what you r asking me to do.
I think i have not made it clear.
I have a mdi parent and two childs. Child one is created on runtime and child two is created only once.
When i load the parent there is a menu which crated and displays the first child. When the first child is displayed i click on another menu and the child two is displayed used to make settings for the mdi child 1, like text and font color.
The problem that i am facing is that when i write on the child 2
Tfrmchild(ActiveMDIChild).txttext.text:='Amol';
the program give me a access violation error.
Since you don't currently have a reference to first child from the 2d child and vice versa, you'll have to do a couple of things to get there:
1. Add a property to ChildForm2 called CallingForm and give it the same type as your ChildForm1 (TForm, I assume.)
2. In the button-click event handler that displays ChildForm2, add code similar to the following PRIOR to showing the form: ChildForm2.CallingForm := self;
3. In the button-click event handler where you're trying to set the value in the text box, add code similar to this:
CallingForm.textbox1.text := textbox2.text;
4. Finish whatever other processing you need and hide ChildForm2.
-Dell
A computer only does what you actually told it to do - not what you thought you told it to do.
Well i am using delphi 7 and how do i get calling form property. Please be a bit more clear. I want to set the properties of a object on a mdi child 1 from a mdi child 2. There may be many instances of mdi child 1...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.