Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VFP 6.0: Wait for form's release

Status
Not open for further replies.

Kimed

Programmer
May 25, 2005
104
LT
Hi,

I have a form with a button that evokes another form and after that one is closed, must refresh itself. Simply making the code like

DO FORM FormName
thisform.Refresh

doesn't work, or, more precisely, Refresh is called immediately after opening the child form, not after it ends its work. I set child form's WindowMode to 1(Modal), but it didn't help; then I tried to call for it with TO clause and a dummy return variable, but I got the error message saying that it is only allowed for forms with WindowMode=Modal... even though it *is* set to Modal. What am I doing wrong? Thanks.
 
As far as I know, there's no such property as WindowMode. To make a form modal, you set its WindowType to 1. You must do that before you invoke the form (in other words at design time).

If you do that, your main form should refresh as soon as the modal form closes.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Sorry, my mistake. It's WindowType, of course, but still, it's set to Modal at design time, and still it doesn't make the calling form wait. Which is the source of confusion to me.
 
Pass the calling form's object reference to the child form and have the child form call the refresh in it's release method.

Code:
DO FORM childform WITH THISFORM 

*child form's init method
LPARAMETERS po_CallingFormObj
this.addproperty('loCallingFormObj', NULL)
if pcount()#0
  this.loCallingFormObj = po_CallingFormObj
endif 

*child form's release method
if !ISNULL(this.loCallingFormObj)
  this.loCallingFormObj.refresh()
endif

Andy Snyder
SnyAc Software Services Hyperware Inc. a division of AmTech Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top