# NewPathCtrl

int NewPathCtrl (int panel, int control, int numberOfVisibleListItems, int displayFullPath?);

## Purpose

Creates a new path control. Like other controls, the path control is discarded by DiscardCtrl and DiscardPanel. Refer to the instrument help for more information about using this control.

| Note This instrument uses the toolbox ChainCtrlCallback function on the path control and the ChainPanelCallback function on the path control's panel and its parent panels. If you change the callback function or callback data of the control or panels, the resulting behavior is undefined. However, you may call ChainCtrlCallback and ChainPanelCallback. You also may set the callback function and callback data for the string control before converting it to a path control. For the same reasons, do not call DuplicatePanel or DuplicateCtrl on any of these panels or the control after the path control has been created.

## Parameters

Input
Name | Type | Description
panel | integer | The handle of the panel for the path control.
control | integer | The ID of a string control that will be converted into a path control. This control must exist on the panel identified by the panel parameter.
numberOfVisibleListItems | integer | The number of items to display in the path control's list box. This value determines the height of the path control's list box.
displayFullPath? | integer | Option that determines whether to display matched full paths or just matched file and directory names in the path control's list.

## Return Value

Name | Type | Description
status | integer | Return value indicating whether the function was successful. A negative number indicates that an error occurred. Call the GetGeneralErrorString toolbox function to get a descriptive error message.