Aktiven Tab löschen

  • Hallo liebe AutoIt.de Gemeinde!

    Ich suche nach einer Funktion mit der man den Aktiven Tab (TabItem) löschen kann.

    [autoit]

    $CreateTab = GUICtrlCreateTab() ;Variable für CreateTab...
    $GUI_main = GUICreate() ;Variable für GUI

    [/autoit]

    ... die Variable für den Tab (TabItem) wird zufalls generiert, dh hab ich irgndwie noch keine Idee wie das gehen soll xD

    • Offizieller Beitrag

    die Variable für den Tab (TabItem) wird zufalls generiert


    Die ID des Item erhältst du doch durch GUICtrlRead(Control, extended)
    Hier mal als Bsp.:

    Spoiler anzeigen
    [autoit]

    #include <GUIConstantsEx.au3>
    Example()

    [/autoit] [autoit][/autoit] [autoit]

    Func Example()
    Local $tab

    $gui = GUICreate("GUI Tab", 400, 230)
    $bDel = GUICtrlCreateButton('Delete Active TabItem', 10, 200, 130, 20)
    $tab = GUICtrlCreateTab(10, 10, 380, 180)
    For $i = 0 To 5
    GUICtrlCreateTabItem('TabItem ' & $i)
    Next
    GUICtrlCreateTabItem("")

    [/autoit] [autoit][/autoit] [autoit]

    GUISetState()

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    If $msg = $tab Then
    WinSetTitle($gui, "", "aktives Tab: " & GUICtrlRead($tab) & ' ID: ' & GUICtrlRead($tab, 1))
    ElseIf $msg = $bDel Then
    GUICtrlDelete(GUICtrlRead($tab, 1))
    WinSetTitle($gui, "", "aktives Tab: " & GUICtrlRead($tab) & ' ID: ' & GUICtrlRead($tab, 1))
    EndIf
    WEnd
    EndFunc ;==>Example

    [/autoit]