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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

determine the change of _vfp.forms.count immediately ?

Status
Not open for further replies.

Inas

Technical User
Sep 9, 2003
20
SG
How to determine the change of _vfp.forms.count immediately, beside using timer to monitor it ?

I try line below :

public oVFP
oVFP = _vfp.forms

before i open any form, in the debugger i saw

oVFP.forms.cnt = 0
_vfp.forms.cnt = 0

When i open a new form :

oVFP.forms.cnt = 1
_vfp.forms.cnt = 1

I expect i create a assign method for oVFP, when the value of the oVFP.forms.cnt change it will run the code in the assign method, but it does not work. can anybody help ?

 
Thanks for help.

Is there any different between _SCREEN.FormCount and _vfp.forms.count. From the VFP help it seen like same.

My main concern is to determine the change of the FormCount in VFP. I'm writing a class that to handle multi language. But current it need to change the baseform class in the init method to call a fucntion to change all the label's captions during the form being call. So i plan to enchance the class to able to handle this but it self. It mean that the label convert function is being call when a form is open.
 
Ggjem,

Have you thought of using BINDEVENT()? That lets you bind a method to a property. As far as I can see, that would include a property of _VFP. I haven't tried it, but in theory it should work. (You need VFP 8.0 or above for this).

Mike


Mike Lewis
Edinburgh, Scotland

My Visual Foxpro web site: My Crystal Reports web site:
 
I have just try the bindevent. But it work with only when when change the property value either by programmatic or intrative. And it couldn't work with _screen.formcount.

I try line below when the object is being init.

BINDEVENT(_SCREEN,"FORMCOUNT",THIS,"TEST")

in the TEST method i write:

WAIT WIND "TESTING"

By the time i open a new form. the _screen.formcount had change from 0 to 1 automatically. But the wait windows "TESTING" does not come out.

However when i bind the test to "TAG" property in a form. and then i change the "tag" to 1 the "test" event fired

Anyone can give some idea?
 
I think you may be approaching this the wrong way. Why not have your form class "announce" (notify) that it's being opened to whatever needs to know?

Rick
 
Rick, thanks for advice. I know that the way i do it is little bit strange..I just want to try to make minimum or even no changes to current existing base form class. If that is now way do determine the _screen.formcount or _vfp.forms.count than i have to do as what you say. Thanks lot.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top