Form - FormOwner Property

The form to which this form belongs in a stack of modal forms

Member of Form (PRIM_FORM)

Data Type - PRIM_FORM - Form is a display area representing a window

Details

The FormOwner property specifies the owner conponent of the form.
 
In multiform applications, regardless of where a form is defined, its owner will default to be the form that started the application.
 
In an scenario where FormA shows FormB which shows FormC, despite logically belonging to FormB, FormC is still owned by FormA. This can cause activation issues if FormC is modal or uses a Message box or similar.
 
Best practice is therefore to set the FormOwner property of FormC before showing it.

Example

In this example, FormB is about to show FormC
Mthroutine Name(ShowFormC)
 
   #FormC.FormOwner <= #Com_owner
   #FormC.ShowModalForm
 
Endroutine

See also

All Component Classes

Technical Reference

Febuary 18 V14SP2