Adapts the window size to the content of controls. The window is resized in order for the controls to be displayed in the best possible way (no empty row and no scrollbar).
Remark: The window is automatically resized if "Adapt the size according to the content" is checked in the "UI" tab of the window description.
// Displays the Table control
// Adapts the size of the window
<Window used>: Optional window name
Name or alias of the window to be used. If this parameter corresponds to an empty string (""), the current window is used.
Conditions required to resize the window
The window must contain at least one of the following controls anchored in width and/or in height:
- List Box control,
- Table control,
- Looper control,
- TreeView control,
- ListView control,
- Multiline edit control.
WinAdaptSize has no effect if the window contains no control corresponding to the criteria.
Effects of resize operation on the window
- The window is reduced if it contains empty rows.
- The window is enlarged in order for all the rows to be visible (including the rows displayed via a scrollbar).
- The window is not enlarged:
- above its maximum size (defined by its maximum width and by its maximum height).
- above the size of the screen.
- The window is not reduced below its minimum size (defined by its minimum width and by its minimum height).
Automatic window resizing
The window is automatically resized if the option "Adapt the size according to the content" is checked in the window description ("UI" tab).