dlgEvent_OnOpenForm

Function called on open form event.

Syntax

PUBLIC FUNCTION dlgEvent_OnOpenForm( 
   currentForm ui.FORM )

The function has one parameter:

  1. currentForm. This is a ui.FORM object referencing the current form. For more information, see The Form class in Genero Business Development Language User Guide.

Usage

When you select the On Open Form property for the creation of the event, a function shell is created. Enter your code in the function.

This function is called to initialize the form by changing the appearance or behavior of items in the form.

Example: On Open Form

This example uses the On Open Form code event for the Account form in the OfficeStore demo.

In this example, the function sets the window text and hides some elements of the form.

PUBLIC FUNCTION dlgEvent_OnOpenForm(currentForm ui.form)

     DEFINE w ui.Window

     DISPLAY "dlgEvent_OnOpenForm (Form scope) is raised"
     
     LET w = ui.Window.getCurrent()
     CALL w.setText("Customer accounts")
     CALL currentForm.setElementHidden("Label17", 1)
     CALL currentForm.setElementHidden("account.sourceapp",1)

     DISPLAY "dlgEvent_OnOpenForm (Form scope) is exited"

END FUNCTION