Information générale
Catégorie:
Codage, syntaxe et commandes
>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
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement