ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage properties / Properties associated with windows, pages and controls
  • Anchor
  • Limits
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
The Anchor property is used to set the anchors of a control. You can:
  • Identify the anchors currently set on a control in a window or report.
  • Modify the characteristics of the anchors set on a control in a window.
Reminder: The anchors of a control define the control behavior (size and location) when the window (or report) is resized.
Several properties are used to define or find out the anchor rate of a control. These properties are as follows:
Example
// Define the anchor characteristics
// The control will be resized vertically and horizontally
LIST_List1.Anchor = anchorWidth + anchorHeight
Syntax

Finding out the anchor of a control Hide the details

<Current anchor> = <Control used>.Anchor
<Current anchor>: Integer constant
Characteristics of anchor currently set on the control.
anchorBottomThe control moves to the bottom.
anchorHeightThe control stretches to the bottom.
anchorRightThe control moves to the right.
anchorTopLeftNo action.
anchorWidthThe control stretches to the right.

anchorRight and anchorWidth can be associated with anchorBottom and anchorHeight.
<Control used>: Control name
Name of control used (window or report control).
Universal Windows 10 AppAndroidiPhone/iPadIOS WidgetMac Catalyst

Modifying the anchors set on a control Hide the details

<Control used>.Anchor = <New anchor>
<Control used>: Control name
Name of control used (window or report control).
<New anchor>: Integer constant
Characteristics of anchor currently set on the control.
anchorBottomThe control moves to the bottom.
anchorHeightThe control stretches to the bottom.
anchorRightThe control moves to the right.
anchorTopLeftNo action.
anchorWidthThe control stretches to the right.

anchorRight and anchorWidth can be associated with anchorBottom and anchorHeight.
Remarks

Anchor

Reminder: use anchors to set the control's size and position when the window or report is resized.
The positions and widths used to calculate the new sizes and positions are the ones defined in the editor. They can be returned by the XInitial, YInitial, InitialWidth and InitialHeight properties.
Universal Windows 10 AppAndroidiPhone/iPadIOS WidgetMac Catalyst Remarks:
  • The Anchor property is not available for columns in Table or TreeView Table controls. The anchors of a column can be specified directly with the AnchorRateWidth property.
  • If the control is associated with a tab pane, the anchor is defined in relation to the Tab control.

Limits

Universal Windows 10 AppAndroidiPhone/iPadIOS WidgetMac Catalyst The Anchor property applies to all the controls in a window.
Universal Windows 10 AppiPhone/iPadIOS Widget The Anchor property applies to all the controls in a report. In this case, you can only find out the type of anchors used.
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help