6 13 6 Showing and Closing the Form

Visual LANSA

6.13.6 Showing and Closing the Form

A multi-form application is created by including forms in another form. The included forms are called member forms and the form in which they are included is called the owner form. For more information refer to 6.19 Multi-Form Applications.

To display a form from inside another form or reusable part, use the ShowForm method:

EVTROUTINE HANDLING(#PHBN_1.Click)
   Invoke #FormA.ShowForm
ENDROUTINE
 

If you want to make sure that a form that is displayed is brought to the front of all open windows use the ActivateForm event. To restore a minimized form, use the RestoreForm method.

To make sure a form is shown to the user regardless of whether it has been minimized, hidden by other forms or not displayed at all, you need to use all the three methods:

EVTROUTINE HANDLING(#PHBN_1.Click)

   if cond('#Form1.windowstate *eq minimized')
      Invoke #Form1.RestoreForm 
   Endif 
   Invoke #Form1.ShowForm 
   Invoke #Form1.ActivateForm
ENDROUTINE

 

Ý 6.13 Forms