General information
Category:
Forms & Form designer
>So, until a third solution is presented, we have:
>
>- tap the _screen.ActiveForm, assuming that that's the form which called, and that its properties hold the parameter (which is not necessarily so but can be arranged)
>- rework the form so that the parameter isn't needed during the instantiation, but can be passed to a method later.
The project I am working on is using Visual MaxFrame(VMP). VMP has a standard global object called oForms that has a method DoForm() which is used to call all forms. DoForm() is passed both the form name and the parameters to the new form. I had a need for parameters in Load() so I added a method to get the parameter from oForms. I changed the Load() method on my base form to get the parameter from oForms and make it available as a property. So, all my forms automatically have access the the parameter in Load().
Generally I pass a single parameter object to forms. I can call AddProperty() and add as many parameters to it I want.
This implementation let me do something else. oForms.DoForm() if called with a form name that was already running activated the existing form. So in Activate() I could check to see if oForms passed any new parameters. So if a user clicks on a button that is supposed to launch a form and start it on a specific record, it still works if the form is already running.
A bit more work to setup, but it has worked for me nicely.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only