# InsertTreeColumn

int InsertTreeColumn (int panelHandle, int controlID, int columnIndex, char columnLabel[]);

## Purpose

Inserts a column into the tree control at the specified zero-based index.

Inserting a new column causes the indices of existing columns at and beyond the insertion point to increase by one.

The function returns the index of the new column or an error.

## 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.
columnIndex | integer | Zero-based index into the tree where InsertTreeColumn places the new column. You cannot insert a column at index 0. Pass –1 to insert the column as the last column.
columnLabel | string | Label of the new tree column. You can pass NULL for the label.

## Return Value

Name | Type | Description
columnIndex | integer | Returns the index of the inserted column. Use the index to specify the tree column in subsequent function calls. Negative values indicate that an error occurred.
Code | Error Message String
xx | Column Index (Success)