PC SOFT

WINDEV的在线文档

  • Overview
  • How to proceed?
  • Anchoring a control in a window
  • Anchoring a control in a tab
  • Anchoring a selection of controls
  • Configuring the anchor by programming
文档页面当前正在翻译。对于此延迟我们深表歉意。
您可以自愿地帮助我们翻译您想要的文档段落,然后只需通过以下地址与我们联系:info@cn.windev.com
产品
WinDevWebDev-服务器代码WebDev-浏览器代码WinDev Mobile报表和查询
平台
WindowsLinuxWindows MobileWindows PhoneWindows Store appsAndroidAndroid Widget iPhone/iPad
语言
JavaPHPAjax用户代码(MCU)外部语言
数据库
HFSQLHFSQL Client/Server存储过程HF 5.5OLE DBODBC本地访问

Overview
The windows found in a WinDev application can be resized at run time. The anchoring mechanism is used to automatically adapt the size and position of the controls when the window is resized.

The management of control anchoring includes two parameters:

  • The control anchoring: this parameter is used to define the modification that will be applied to the control according to the change of window size. The control can move to the left and/or to the bottom, it can be enlarged in width and/or in height.
  • The anchor rate: this parameter is used to manage the percentage by which the control is moved or stretched. This parameter allows you to:
    • keep a control centered in width in the window regardless of its size,
    • proportionally enlarge some window controls.
These parameters can be configured:
  • In the window editor.
  • by programming with the WLanguage properties.

How to proceed?

Anchoring a control in a window

To anchor a control in a window:
  1. Select one or more controls to anchor.
  2. Define the anchoring of the controls:
    • in the "GUI" tab of the description window of the control ("Description" from the popup menu of the control),
    • via "Anchor" from the popup menu of the control.
  3. In this window, choose the type of anchoring that will be used. The most common options are represented by icons:
No anchorThe control is not modified when the window is resized. No anchoring option is selected.
WidthThe control stretches to the right when the window is enlarged. To change the speed at which a control stretches in relation to the window, use the anchor rate in width.
RightThe controls moves to the right when the window is enlarged. To make the control move slower or faster, use the anchor rate on the right.
Centered in widthThe control remains centered in width in the window regardless of the window width.
HeightThe control stretches toward the bottom when the window height is enlarged. To change the speed at which a control stretches in relation to the window, use the anchor rate in height
Width and HeightThe control stretches to the right and to the bottom when the window is enlarged. To change the speed at which a control stretches in relation to the window, use the anchor rate in height and the anchor rate in width.
Height and RightThe control stretches toward the bottom and moves toward the right when the window is enlarged.
To make the control move slower or faster, use the anchor rate on the right.
To change the speed at which a control stretches in relation to the window, use the anchor rate in height.
Vertical DistributionThis option is available only when several controls are selected. The anchoring options are used to keep a vertical distribution of the selected controls when the window is enlarged in height.
BottomThe control moves to the bottom when the window is enlarged toward the bottom. To make the control move slower or faster, use the anchor rate to the bottom.
Width and BottomThe control stretches to the right and moves to the bottom when the window is enlarged.
To make the control move slower or faster, use the anchor rate to the bottom.
To change the speed at which a control stretches in relation to the window, use the anchor rate in width.
Right and BottomThe control moves to the right and to the bottom when the window is enlarged. To make the control move slower or faster, use the anchor rate to the bottom and the anchor rate to the right.
Horizontally centered at bottomThe control remains centered in width in the window regardless of the window width. However, the control is anchored to the right and it moves to the right when the window is enlarged.
To make the control move slower or faster, use the anchor rate to the bottom.
Centered in heightThe control remains centered in height in the window regardless of the window height.
Horizontal DistributionThis option is available only when several controls are selected. The anchoring options are used to keep an horizontal distribution of the selected controls when the window is enlarged.
Vertically centered to rightThe control remains centered in height in the window regardless of the window height. However, the control is anchored to the right and it moves to the right when the window is enlarged.
To make the control move slower or faster, use the anchor rate on the right.
CenteredThe control remains centered in height and in width in the window regardless of the window size.

4. Define (if necessary) the different anchor rates.
5. Validate.If "Display .. Options .. Show the anchors" is enabled, the anchoring markers are automatically displayed in the control (red arrows).To display the anchoring markers in the control (red arrows), on the "显示" pane, in the "查看(所有控件)" group, check "锚定".

Anchoring a control in a tab

A control displayed in a tab is anchored in relation to the tab and not to the window.

Anchoring a selection of controls

To anchor a selection of controls, select "Anchor" from the popup menu (right mouse click) of the selection.

Configuring the anchor by programming
Several WLanguage properties allow you to configure the anchor of the controls by programming:
09版本和更高版本
锚定
09新版本
锚定
锚定
..锚定 is used to manage the anchor of a control in a window or report.
09版本和更高版本
垂直锚定比例
垂直锚定比例
..垂直锚定比例 is used to:
  • Find out the anchor rate when a control moves on the vertical axis
  • Modify the anchor rate when a control moves on the vertical axis.
09版本和更高版本
水平锚定比例
水平锚定比例
..水平锚定比例 is used to:
  • Find out the anchor rate when a control moves on the horizontal axis
  • Modify the anchor rate when a control moves on the horizontal axis.
09版本和更高版本
高度锚定率
09新版本
高度锚定率
高度锚定率
..高度锚定率 is used to:
  • Find out the anchor rate in height of a control
  • Modify the anchor rate in height of a control.
09版本和更高版本
宽度锚定率
09新版本
宽度锚定率
宽度锚定率
..宽度锚定率 is used to:
  • Find out the anchor rate when a control (or a table column) stretches on the horizontal axis.
  • Modify the anchor rate when a control (or a table column) stretches on the horizontal axis.