Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Communicating between forms
Message
 
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00143896
Message ID:
00143940
Views:
24
Michelle,

This could be as simple as putting a timer in each form looking for recno() changes.

Although I'd probably an explicit broadcast of an I'veChangedAddress message to an object that would then pass that on to the other forms. You might just let the parent form be that object and keep references to it in the child form. So when you launch the child forms from the parent:
do AddressForm with thisform

<b>AddressForm.Init():</b>
lparameter roLaunchingForm
this.moParentForm = roLaunchingForm
this.moParentForm.LinkChild( thisform ) && allow parentform to get a link to the child form

<b>In the AddressForm.Destroy:</b>
this.moParentForm = .null.

<b>When the address record changes:</b>
this.moParentForm.AddressChanged( thisform )

<b>The parent form.AddressChanged():</b>
lparameter roChangingForm
for each oChild in this.maChildForms
   if ( roChangingForm.Name != oChild.Name )
      oChild.AddressChanged()
   endif
endfor

<b>parent form.LinkChild</b>
lparameter roChildForm
this.mnChildForms = this.mnChildForms + 1
dimension this.maChildForms[this.mnChildForms]
this.maChildForms[this.mnChildForms] = roChildForm

<b>parent form.Release</b>
for i = 1 to this.mnChildForms
   this.maChildForms[i] = .null.
endfor
If you always launch all of the forms and they are the only ones running you could iterate through the _screen.Forms[] collection. But the above stuff gives you an idea of how to use object references back and forth between different objects.
>Well, I was trying to do things like clicking on an address in a grid causes it to highlight that spot on the map and show the details of the trip in the details window. After playing around for a while, I figured out how to get it all on one form. So I'm going to try that first and see how it goes before trying to mess with multiple forms.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform