Discussion:
Getting to window under a modal
(too old to reply)
battles
2011-12-25 19:38:08 UTC
Permalink
I need to access the parent Form1 under its called modal Form2. As
you know, when you call the Form2 with Form2.ShowModal in Form1, Form1
is no longer accessible. I need to allow changes on Form1 after the
Form2.ShowModal is activated (need to test the modal results). I
tried using a Form2.Show with a perpetual while-until loop, but this
causes other problems so I can't use it.

Anyone know how this might be done?
Jamie
2011-12-25 22:07:50 UTC
Permalink
Post by battles
I need to access the parent Form1 under its called modal Form2. As
you know, when you call the Form2 with Form2.ShowModal in Form1, Form1
is no longer accessible. I need to allow changes on Form1 after the
Form2.ShowModal is activated (need to test the modal results). I
tried using a Form2.Show with a perpetual while-until loop, but this
causes other problems so I can't use it.
Anyone know how this might be done?
In the unit that contains the form2. at the implementation section put
in USES unit1; or what ever unit FORM1 is in.

so something like..

unit1.form1.SomeProperty, Member etc = ???????

Also. Another way to handle such things is use a common
dispatch function in all forms that may have to talk to this
form2. THe idea being is, form1 for example could first set a
object pointer in form2 code where form2 could set data in this
object and it would reflect back to form1.

If your app is going to be intense in this manner, I'd suggest you
come up with some form or proxy protocol to exchange date between forms.

Jamie
Maarten Wiltink
2011-12-29 21:50:54 UTC
Permalink
Post by battles
I need to access the parent Form1 under its called modal Form2. As
you know, when you call the Form2 with Form2.ShowModal in Form1, Form1
is no longer accessible. I need to allow changes on Form1 after the
Form2.ShowModal is activated (need to test the modal results). ...
There is no ModalResult until Form2 closes and control returns to Form1
anyway. So what do you really want?

Groetjes,
Maarten Wiltink

Loading...