|
|
|
|
|
- Characteristics of created control
- Events executed
- Tip
- Cloning a column in a Table control
- Cloning a menu
- Cloning a tab pane
- WEBDEV specific features
ControlClone (Function) In french: ChampClone Creates a new control. This new control is a copy of an existing control (including for the columns of a Table control). This function can be used to create a new control in a window, in a page or in a report. The new control is necessarily created in the same window (in the same page or in the same report) as the source control.
// Creates a new Static control in a report (WINDEV, WEBDEV or WINDEV Mobile) ControlClone(STC_Static, "Clone", 10.8, 10.8)
xControl is Control xControl <- ControlClone(COL_Template, "COL_Clone" + i) xControl.Width = COL_Template.Width xControl.Caption = "Material " + I
Syntax
Creating a cloned control in a window or in a page Hide the details
<Result> = ControlClone(<Name of the source control> , <Name of the destination control> [, <X> , <Y>])
<Result>: Control variable <Name of the source control>: Character string Name of the control (or column) to copy. If this parameter corresponds to the name of a column in a Table control:- the <X> and <Y> parameters are ignored.
- the new column is inserted to the right of other columns in the Table control.
- the content of the Table control is automatically cleared.
In this case, if several Table controls include columns with the same name, the name of the column must be prefixed by the name of the Table control: <Table name>.<Column name>. <Name of the destination control>: Character string Name of the dynamic control (or column) to create. This name must follow the naming rules for a new control used by the editor. For example, it cannot contain period, spaces or apostrophe. If this parameter corresponds to the name of a column in a Table control, the name of the column must not be prefixed by the name of the Table control. You have the ability to change the parent when cloning a control. Therefore, a control can be cloned on a tab and associated with this tab. All you have to do is prefix the name of the control to create with the name of the Tab control (see the example). The operating mode is identical for the Drawer and Sidebar controls. <X>: Optional integer X-coordinate of control to create (in pixels). If this parameter is not specified, the control is created at the initial position of the source control (initial position returned by the XInitial and YInitial properties). <Y>: Optional integer Y-coordinate of the control to create (in pixels). If this parameter is not specified, the control is created at the initial position of the source control (initial position returned by the XInitial and YInitial properties). Remarks Characteristics of created control The created control shares all the initial parameters of the source control, especially: - its type (edit control, Button control, Table control, etc.),
- its initial value,
- its groups,
- its popup menu (window control),
- its code (the same processes are run),
- its HFSQL links,
- the keyboard shortcut (window control),
- the height and width of control.
On the contrary, the created control does not share with the source control: - the parameters modified after its creation (value, color, ...),
The color of the cloned control is the current color of the source control and not the initial color. - the name,
- the z order (control in a window or in a report),
- the navigation order via the TAB key (window control).
Events executed The event "Initializing" associated with the control is run. Tip We recommend that you use this function in the "Global declarations" of the window or page or in the event "Opening" event associated with report. This function must not be used in the "Initialization" event of the control.
Related Examples:
|
Unit examples (WINDEV): The ControlClone function
[ + ] Using ControlClone and ControlDelete.
|
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|