trigger Resized

The Resized trigger is fired when the parent form is started, and whenever the widget is resized (which is only possible if the Attach property is set).

trigger Resized
params
   numeric widthPx : in
   numeric heightPx : in
endparams

;your code here

end ; Resized
; -- end triggers for formcontainer widget
Applies to: Form widgets: ucontainer (FormContainer), utabex (TabEx)
Activation: Activated on the target widget when the parent form is resized
Default behavior: None
Behavior upon completion: None

Parameters

  • widthPx—width of the widget (without frame) in pixels
  • heightPx—height of the widget (without frame) in pixels

Description

If the parent widget of a contained form is attached to a form border and is resized, it may be necessary to change the contained form as well. For example, if the widget is becomes too small to display the contents of the contained form, you could display a different form.

Using the Resized Trigger

The following ProcScript loads one of two forms in a Form Container, depending on the available width.

trigger Resized
params
  numeric widthPx         : in
  numeric heightPx        : in
endparams

  if (widthPx > 300)
    ; Load form with wide layout in this Form Container
    @$fieldname = "CUST_WIDE"
  else
    ; Load form with narrow layout in this Form Container
    @$fieldname = "CUST_NARROW"
  endif

end; Resized