Admin Production ni-theme
Current Publication

DuplicateCtrl

LabWindows/CVI

DuplicateCtrl

int DuplicateCtrl (int sourcePanelHandle, int controlID, int destinationPanelHandle, char duplicateLabel[], int controlTop, int controlLeft);

Purpose

Copies an existing control from the source panel to the destination panel and returns a control ID. You can use the control ID to reference the control in subsequent function calls.

Supported Controls

You can use DuplicateCtrl with all LabWindows/CVI user interface controls.

Parameters

Input
Name Type Description
sourcePanelHandle int Handle of the source panel containing the control to duplicate. You obtain this handle from LoadPanel, NewPanel, or DuplicatePanel.
controlID int The defined constant, located in the .uir header file, that you assigned to the control in the User Interface Editor, or the ID returned by functions such as NewCtrl and DuplicateCtrl.
destinationPanelHandle int The parent panel into which to copy the duplicate control. You obtain this handle from LoadPanel, NewPanel, or DuplicatePanel.
duplicateLabel char [] Label for the duplicate control. Pass "" for no label. Pass 0 to use the label of the source control.
controlTop int Vertical coordinate at which to place the upper left corner of the control, not including labels.

The valid range for controlTop is –32,768 to 32,767 or VAL_KEEP_SAME_POSITION. The origin (0,0) is at the upper-left corner of the panel, directly below the title bar, before the panel is scrolled.
controlLeft int Horizontal coordinate at which to place the upper left corner of the control, not including labels.

The valid range for controlLeft is –32,768 to 32,767 or VAL_KEEP_SAME_POSITION. The origin (0,0) is at the upper-left corner of the panel, directly below the title bar, before the panel is scrolled.

Return Value

Name Type Description
duplicateControlID int Returns the ID you use to specify the new (duplicate) control in subsequent function calls. Negative values indicate that an error occurred. Zero is not a valid ID.

Additional Information

Library: User Interface Library

Include file: userint.h

LabWindows/CVI compatibility: LabWindows/CVI 3.0 and later

Example

Refer to userint\tabpanels.cws for an example of using the DuplicateCtrl function.