# Function Reference

# _GUICtrlTab_ClickTab

Clicks a tab

#include <GuiTab.au3>
_GUICtrlTab_ClickTab ( $hWnd, $iIndex [, $sButton = "left" [, $bMove = False [, $iClicks = 1 [, $iSpeed = 1]]]] )

## Parameters

$hWnd | Control ID/Handle to the control
$iIndex | Specifies the 0-based index of the item
$sButton | [optional] Button to click with
$bMove | [optional] If True, the mouse will be moved. If False, the mouse does not move.
$iClicks | [optional] Number of clicks
$iSpeed | [optional] Mouse movement speed

## Return Value

None.

## Example

    #include "Extras\HelpFileInternals.au3"

    #include <GUIConstantsEx.au3>
    #include <GuiTab.au3>
    #include <MsgBoxConstants.au3>

    Example()

    Func Example()
        ; Create GUI
        Local $hGUI = GUICreate("Tab Control Click Tab - v(" & @AutoItVersion & ")", 450, 300, 100, 100)
        Local $idTab = GUICtrlCreateTab(2, 2, 446, 266)
        _MemoMsgBoxStatus() ; Status creation

        GUISetState(@SW_SHOW)

        ; Add tabs
        _GUICtrlTab_InsertItem($idTab, 0, "Tab 0")
        _GUICtrlTab_InsertItem($idTab, 1, "Tab 1")
        _GUICtrlTab_InsertItem($idTab, 2, "Tab 2")

        _MemoMsgBox($MB_SYSTEMMODAL, "Information", "Tab Control Click")
        ; Click Tab
        _GUICtrlTab_ClickTab($idTab, 1, "left", True, 100)

        _MemoMsgBoxStatus("", -1, $hGUI) ; no more action, wait GUI for closing

    EndFunc   ;==>Example