OnResizeWindow - cWebApp

Fired when the window size of the browser changes at runtime and during initialization

Type: Event

Parameters: Integer iWindowWidth Integer iWindowHeight

ParameterDescription
iWindowWidthThe new window width in pixels
iWindowHeightThe new window height in pixels


Syntax
Procedure OnResizeWindow Integer iWindowWidth Integer iWindowHeight

Description

This event is fired when the window size of the browser changes at runtime and during initialization. This event can be used to make the WebApp responsive to the screen size by changing properties like pbShowLabel and pbRender using WebSet. The event gets the window size in pixels as parameter.

Sample

The example below shows how this event can be used to hide the labels of a toolbar when the window size gets below 600 pixels.

Set pbServerOnResizeWindow to True

Procedure OnResizeWindow Integer iWindowWidth Integer iWindowHeight
    WebSet pbShowCaption of (oFileToolBar(oCommandBar)) to (iWindowWidth > 600)
End_Procedure

See Also

pbServerOnResizeWindow | psClientOnResizeWindow