PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Characteristics of created control
  • Processes run
  • Tip
  • Cloning a column in a Table control
  • Cloning a menu
  • Cloning a tab pane
  • Specific WEBDEV features
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
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 or in a report.
The new control is necessarily created in the same window (or in the same report) as the source 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.
WEBDEV - Server code In this version, this function can only be used to create a new control in a report. The new control is necessarily created in the same report as the source control.
Versions 16 and later
Android This function is now available for the Android applications.
Linux This function is now available in Linux, for the reports and for the windows.
New in version 16
Android This function is now available for the Android applications.
Linux This function is now available in Linux, for the reports and for the windows.
Android This function is now available for the Android applications.
Linux This function is now available in Linux, for the reports and for the windows.
Versions 17 and later
WINDEVWindowsLinux This function is now available for cloning the tab panes.
New in version 17
WINDEVWindowsLinux This function is now available for cloning the tab panes.
WINDEVWindowsLinux This function is now available for cloning the tab panes.
Versions 18 and later
Universal Windows 10 App This function is now available in Windows Store apps mode.
iPhone/iPad This function is now available in the reports for iPhone/iPad applications.
New in version 18
Universal Windows 10 App This function is now available in Windows Store apps mode.
iPhone/iPad This function is now available in the reports for iPhone/iPad applications.
Universal Windows 10 App This function is now available in Windows Store apps mode.
iPhone/iPad This function is now available in the reports for iPhone/iPad applications.
Versions 19 and later
iPhone/iPad This function is now available in the windows for iPhone/iPad applications.
New in version 19
iPhone/iPad This function is now available in the windows for iPhone/iPad applications.
iPhone/iPad This function is now available in the windows for iPhone/iPad applications.
Versions 21 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
WEBDEV - Server code This function is now available for the controls in the WEBDEV pages.
New in version 21
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
WEBDEV - Server code This function is now available for the controls in the WEBDEV pages.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
WEBDEV - Server code This function is now available for the controls in the WEBDEV pages.
Versions 17 and later
WINDEV
// Creates a new pane in a Tab control
ControlClone(TAB_MyTab[1], "Pane 3")

// Creates a cloned control in a Tab pane
// while the source control is found in the window
ControlClone(EDT_EDIT1, "TAB_MyTab[2].CLONE_EDIT1")
New in version 17
WINDEV
// Creates a new pane in a Tab control
ControlClone(TAB_MyTab[1], "Pane 3")

// Creates a cloned control in a Tab pane
// while the source control is found in the window
ControlClone(EDT_EDIT1, "TAB_MyTab[2].CLONE_EDIT1")
WINDEV
// Creates a new pane in a Tab control
ControlClone(TAB_MyTab[1], "Pane 3")

// Creates a cloned control in a Tab pane
// while the source control is found in the window
ControlClone(EDT_EDIT1, "TAB_MyTab[2].CLONE_EDIT1")
// Creates a new Static control in a report (WINDEV, WEBDEV or WINDEV Mobile)
ControlClone(STC_Static, "Clone", 10.8, 10.8)
WINDEVReports and QueriesiPhone/iPadWindows MobileUniversal Windows 10 AppJavaUser code (UMC)
// Creates a new edit control
ControlClone(EDT_Address,"Clone",10, 10)
xControl is Control
xControl <- ControlClone(COL_Template, "COL_Clone" + i)
xControl..Width = COL_Template..Width
xControl..Caption = "Material " + i
Syntax
WINDEVReports and QueriesAndroidiPhone/iPadWindows MobileUniversal Windows 10 AppJavaUser code (UMC)

Creating a cloned control in a window Hide the details

<Result> = ControlClone(<Name of Source Control in Window>, <Name of Destination Control> [, <X> , <Y>])
<Result>: Control variable
Versions 19 and later
WINDEV Name of the Control variable that will be associated with the cloned control.
New in version 19
WINDEV Name of the Control variable that will be associated with the cloned control.
WINDEV Name of the Control variable that will be associated with the cloned control.
<Name of Source Control in Window>: Character string (without quotes)
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 the other columns of 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 Destination Control>: Character string (with quotes)
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.
Versions 17 and later
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 HideShow and Sidebar controls.
New in version 17
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 HideShow and Sidebar controls.
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 HideShow 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 ..XInitial and ..YInitial).
<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 ..XInitial and ..YInitial).

Creating a cloned control in a window or in a page Hide the details

<Result> = ControlClone(<Name of Source Control>, <Name of Destination Control> [, <X> , <Y>])
<Result>: Control variable
WINDEVWEBDEV - Server code Name of the Control variable that will be associated with the cloned control.
<Name of Source Control>: Character string (without quotes)
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 the other columns of 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 Destination Control>: Character string (with quotes)
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.
Versions 17 and later
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 HideShow and Sidebar controls.
New in version 17
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 HideShow and Sidebar controls.
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 HideShow 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 ..XInitial and ..YInitial).
<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 ..XInitial and ..YInitial).
WINDEVWEBDEV - Server codeReports and QueriesiPhone/iPadWindows MobileUniversal Windows 10 AppUser code (UMC)

Creating a cloned control in a report Hide the details

<Result> = ControlClone(<Name of Source Control in Report>, <Name of Destination Control> [, <X> , <Y>])
<Result>: Control variable
Versions 19 and later
WINDEVWEBDEV - Server code Name of the Control variable that will be associated with the cloned control.
New in version 19
WINDEVWEBDEV - Server code Name of the Control variable that will be associated with the cloned control.
WINDEVWEBDEV - Server code Name of the Control variable that will be associated with the cloned control.
<Name of Source Control in Report>: Character string (without quotes)
Name of the control to copy.
<Name of Destination Control>: Character string (with quotes)
Name of the dynamic control to create.
<X>: Optional real
X coordinate of the control to create (in millimeters).
If this parameter is not specified, the control is created at the initial position of the source control (initial position returned by ..XInitial and ..YInitial).
<Y>: Optional real
Y coordinate of the control to create (in millimeters).
If this parameter is not specified, the control is created at the initial position of the source control (initial position returned by ..XInitial and ..YInitial).
Remarks

Characteristics of created control

The created control shares all the initial parameters of the source control, especially:
  • its type (edit, button, table, ...),
  • 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, ...),
    Versions 21 and later
    WEBDEV - Server code The color of the cloned control is the current color of the control (and not the creation color of the control).
    New in version 21
    WEBDEV - Server code The color of the cloned control is the current color of the control (and not the creation color of the control).
    WEBDEV - Server code The color of the cloned control is the current color of the control (and not the creation color of the control).
  • the name,
  • the z order (control in a window or in a report),
  • the navigation order via the TAB key (window control).
  • the height and width of control.
Caution: Change of behavior between version 15 and version 16:
In version 15, the initial height and width of the control are taken into account for the cloned control.
From version 16, the height and width of the displayed control are taken into account for the cloned control.

Processes run

The initialization code of the control is run.
The control being unknown when compiling the project, it can be handled by the indirection operators.

Tip

This function should be used in the declaration code of global variables of the window or page, or in the opening code of the report. This function must not be used in the initialization code of the control.
WINDEVWEBDEV - Server codeReports and QueriesiPhone/iPadWindows MobileJavaUser code (UMC)

Cloning a column in a Table control

In a window, when ControlClone is used on a column of a Table control, the Table control is entirely cleared when the new column is created.
WINDEVReports and QueriesAndroidWindows MobileJavaUser code (UMC)

Cloning a menu

A menu can be cloned by MenuClone.
Versions 17 and later
WINDEV

Cloning a tab pane

When using ControlClone on a tab pane, the pane and all the controls found in this tab pane are cloned (including the associated code). In the initial tab pane, if processes handled the controls found in this pane, in the cloned pane, these processes will automatically handle the controls of the cloned pane.
New in version 17
WINDEV

Cloning a tab pane

When using ControlClone on a tab pane, the pane and all the controls found in this tab pane are cloned (including the associated code). In the initial tab pane, if processes handled the controls found in this pane, in the cloned pane, these processes will automatically handle the controls of the cloned pane.
WINDEV

Cloning a tab pane

When using ControlClone on a tab pane, the pane and all the controls found in this tab pane are cloned (including the associated code). In the initial tab pane, if processes handled the controls found in this pane, in the cloned pane, these processes will automatically handle the controls of the cloned pane.
Versions 21 and later
WEBDEV - Server code

Specific WEBDEV features

  • A control and its cloned control must be found in the same page.
  • The following controls can be cloned:
    • The stackable controls.
    • The controls found in a Rich Text Area.
    • The table columns.
  • Cloning a control found in a Rich Text Area:
    • The cloned control can be added into any Rich Text Area of the page.
    • The cloned control cannot be added into a rich Static (in a check box or radio button for example).
  • Cloning a stackable control:
    • The cloned control is a stackable control.
    • The cloned control has no anchor.
    • The cloned control is added to the same container as the source control.
  • Cloning a control found in a Looper: A control found in a Looper must be cloned in a Looper.
  • The pages in "Mode compatible with version 16" mode cannot be used to clone controls.
  • Using an indirection to handle the cloned control forces the control to be a dynamic control.
New in version 21
WEBDEV - Server code

Specific WEBDEV features

  • A control and its cloned control must be found in the same page.
  • The following controls can be cloned:
    • The stackable controls.
    • The controls found in a Rich Text Area.
    • The table columns.
  • Cloning a control found in a Rich Text Area:
    • The cloned control can be added into any Rich Text Area of the page.
    • The cloned control cannot be added into a rich Static (in a check box or radio button for example).
  • Cloning a stackable control:
    • The cloned control is a stackable control.
    • The cloned control has no anchor.
    • The cloned control is added to the same container as the source control.
  • Cloning a control found in a Looper: A control found in a Looper must be cloned in a Looper.
  • The pages in "Mode compatible with version 16" mode cannot be used to clone controls.
  • Using an indirection to handle the cloned control forces the control to be a dynamic control.
WEBDEV - Server code

Specific WEBDEV features

  • A control and its cloned control must be found in the same page.
  • The following controls can be cloned:
    • The stackable controls.
    • The controls found in a Rich Text Area.
    • The table columns.
  • Cloning a control found in a Rich Text Area:
    • The cloned control can be added into any Rich Text Area of the page.
    • The cloned control cannot be added into a rich Static (in a check box or radio button for example).
  • Cloning a stackable control:
    • The cloned control is a stackable control.
    • The cloned control has no anchor.
    • The cloned control is added to the same container as the source control.
  • Cloning a control found in a Looper: A control found in a Looper must be cloned in a Looper.
  • The pages in "Mode compatible with version 16" mode cannot be used to clone controls.
  • Using an indirection to handle the cloned control forces the control to be a dynamic control.
Related Examples:
The ControlClone function Unit examples (WINDEV): The ControlClone function
[ + ] Using ControlClone and ControlDelete.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230vm.dll
Windows Mobile wp230vm.dll
Java wd230java.jar
Linux wd230vm.so
Android wd230android.jar
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment