Admin Production ni-theme
Current Publication

AddCtrlToSplitter

LabWindows/CVI

AddCtrlToSplitter

int AddCtrlToSplitter (int panelHandle, int controlID, int anchor, int controlToAttach, int snapOnAttach, int attachmentMode);

Purpose

Attaches a new control to the splitter control. Once attached, this control is automatically sized or moved whenever you operate the splitter.

The control to be attached must already be present in the same panel as the splitter.

Supported Controls

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

Parameters

Input
Name Type Description
panelHandle int Specifier for a particular panel that is currently in memory. You can obtain this handle from functions such as LoadPanel and NewPanel.
controlID int The ID of the splitter control. Pass the defined constant, located in the .uir header file, that you assign to the control in the User Interface Editor, or the ID returned by functions such as NewCtrl and DuplicateCtrl.
anchor int This parameter determines to which edge of the splitter control you are attaching the control. For horizontal splitters, valid choices are VAL_TOP_ANCHOR and VAL_BOTTOM_ANCHOR. For vertical splitters, valid choices are VAL_LEFT_ANCHOR and VAL_RIGHT_ANCHOR.

Constant Name Constant Value
VAL_RIGHT_ANCHOR -2147483633
VAL_LEFT_ANCHOR -2147483634
VAL_BOTTOM_ANCHOR -2147483635
VAL_TOP_ANCHOR -2147483636

Which edge of the splitter you attach a control determines how the control is sized. For example, if you attach a control to the left edge of the splitter, then the right edge of the control follows the splitter, thus sizing the control.
controlToAttach int The control to attach.

Pass 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 NewCtrl or DuplicateCtrl.
snapOnAttach int Specify a nonzero value or select Yes in the function panel if you want the control that is being attached to automatically move to the corresponding edge of the splitter control. For example, if you pass VAL_BOTTOM_ANCHOR as the anchor parameter, LabWindows/CVI places the control immediately below the splitter. In this case, the horizontal position of the control would not be affected.

Specify 0 or select No in the function panel otherwise.
attachmentMode int Specify a nonzero value or select Move control in the function panel to move the control that is being attached when you operate the splitter control.

Specify 0 or select Size control in the function panel to size the control that is being attached when you operate the splitter control. If you pass 0, you must ensure that the type of control that you are attaching can be sized in the direction that is perpendicular to the splitter control.

Return Value

Name Type Description
status int Return value indicating whether the function was successful. A negative number indicates that an error occurred.

Additional Information

Library: User Interface Library

Include file: userint.h

LabWindows/CVI compatibility: LabWindows/CVI 7.1 and later