# MoveTabPage

int MoveTabPage (int panelHandle, int controlID, int index, int destinationIndex);

## Purpose

Moves a tab page to another position in the tab control. The new position is defined by the destination index.

Moving a tab page changes the indices of the existing tab pages between the original index and the final index of the tab page to be moved.

The function returns the new index of the moved tab page 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.
index | integer | Zero-based index of the tab page to move.
destinationIndex | integer | Identifies the new position of the tab page to be moved. Pass –1 to move the tab page to the end of the list.

## Return Value

Name | Type | Description
movedToIndex | integer | Returns the index of the moved tab page. Use the index to specify the tab page in subsequent function calls. Negative values indicate that an error occurred.
Code | Error Message String
xx | Tab Page Index (Success)