PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Characteristics of created control
  • Events run
  • Tip
  • Cloning a column in a Table control
  • Cloning a menu
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.
Versions 16 and later
Android This function is now available for Android applications.
New in version 16
Android This function is now available for Android applications.
Android This function is now available for Android applications.
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.
New in version 21
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
// Creates a new Static control in a report (WINDEV, WEBDEV or WINDEV Mobile)
ControlClone(STC_Static, "Clone", 10.8, 10.8)
iPhone/iPadWindows MobileUniversal Windows 10 App
// 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
AndroidiPhone/iPadWindows MobileUniversal Windows 10 App

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
<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 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 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
<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 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 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).
iPhone/iPadWindows MobileUniversal Windows 10 App

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
<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 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 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.

Events run

The event "Initializing" associated with the control is run.
The control being unknown when compiling the project, it can be handled by the indirection operators.

Tip

We recommend that you use this function in the event "Global declarations" of the window or page or in the event "Opening" associated with report. This function must not be used in the event "Initializing" of the control.
iPhone/iPadWindows Mobile

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.
AndroidWindows Mobile

Cloning a menu

A menu can be cloned by MenuClone.
Related Examples:
The ControlClone function Unit examples (WINDEV): The ControlClone function
[ + ] Using ControlClone and ControlDelete.
Component : wd240vm.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Clonando uma pergunta de um questionario
PROCEDURE SC_001_Resposta_Edt_Nota(posY, LayoutNum, TITULO_GRUPO, PERGUNTA, NOTA, RESPOSTA, PESO, PARAMETROS)

x++
xControl is Control
xControl <- ControlClone(SC_001_Resposta_Edt_Nota, "LAYOUT_Questionario["+LayoutNum+"].SC_001_Resposta_Edt_Nota_0"+x)
xControl..X = 25
xControl..Y = posY
xControl..Width = TamanhoHorizontal
xControl..Height = 144
posY += 144
posicao = posY

//----------------------------------------------------------------------------
xControl.CTPL_GRUPO_TITULO.STC_TITULO_GRUPO = TITULO_GRUPO
xControl.CTPL_P000.STC_P000 = PERGUNTA
xControl.CTPL_P000.STC_PESO = PESO
xControl.CTPL_P000.STC_PARAMETROS = PARAMETROS
xControl.RATE_NOTA = NOTA
xControl.CTPL_E000.EDT_R = RESPOSTA
//----------------------------------------------------------------------------

RESULT posY
BOLLER
08 Aug. 2019
Video ControlClone
https://youtu.be/JRtYtuMI35E

//

CLONE_EDT is Control
CLONE_EDT <- ControlClone(EDT_NOME,"EDT_NOME1")
CLONE_EDT..X=8
CLONE_EDT..Y=154
CLONE_EDT..Caption="ENDERECO"
amarildo
04 Jan. 2019