# AddCtrlToSplitter

int AddCtrlToSplitter (int panel, int control, int anchor, int attachedControl, int snapOnAttach, int move);

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

## Parameters

Input
Name | Type | Description
panelHandle | integer | Specifier for a particular panel that is currently in memory. You obtain this handle from LoadPanel, NewPanel, or DuplicatePanel.
controlID | integer | 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.
anchor | integer | 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 | 0x8000000F
VAL_LEFT_ANCHOR | 0x8000000E
VAL_BOTTOM_ANCHOR | 0x8000000D
VAL_TOP_ANCHOR | 0x8000000C
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.
controlID | integer | 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 | integer | Pass TRUE 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.
move | integer | Pass TRUE if you want the control that is being attached to be moved instead of sized, whenever you operate the splitter control. If you pass FALSE, 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 | integer | Return value indicating whether the function was successful. A negative number indicates that an error occurred.
Code | Error Message String
xx | Success