Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Get form reference
Message
From
30/08/1999 17:33:18
 
 
To
30/08/1999 01:24:02
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00258270
Message ID:
00259422
Views:
20
>Hi,
> I think I didn't explain my problem in details and cause you misunderstood.
> Like this, I have a top level form as Main windows for my application. When user click on my menu , my menu will call main windows's user defined method (doform()) for DO FORM operation .
> First at all, user click on my menu to call frmA. Then, user might then call other form from my menu (e.g. frmSearch) too.
> Now, there are 2 forms in my main windows. I need to reference frmA's user defined method from frmSearch which frmSearch is active form at that moment. I failed to reference frmA because the DO FORM operation is called in a method and the form name can't be referenced.
> I was told that to has a public variable and use DO FORM frmA NAME var, but it is not flexible if I wat to have more general getformreference function.
>How could I do so?
>
>Thank you

Well... if frmSearch is always going to refer to the form that is active when it is started, in the init of form search you can check to see what form is active... (since when search is in init form A will be active.)

frmSearch::Init()

this.oActiveForm = _screen.ActiveForm

******
Another thing you can do is have your toolbar call a method in your active form which calls the search form.

So, your toolbar has code like...

_screen.ActiveForm.RunSearchForm()

Then in form A you can have...

frmA::RunSearchForm()

DoForm( 'frmSearch', this )

^^^^^ modify your DoForm to pass parameters to the form that is loaded. This will pass a reference from frmA to the search forms Init param when it is started... then in search form init you have code like:

lparms toCallingForm

this.oCallingForm = toCallingForm


BOb
Previous
Reply
Map
View

Click here to load this message in the networking platform