Auf der GUI ein Bestimmter Tab als Standart

  • Hey Leute,
    ich habe mal eine Frage. Weiß jemand, wie ich bei Tabs ein Art Standarttab einrichten bzw ändern kann? Also der automatisch vorne ist, wenn Anwendung gestarten wird? Darüber hinaus, ist es einfach den Text vom Tabreiter ab zu lesen? Also auslesen und in eine Variable schreiben?

    Irgendwie fand ich nichts für den Tab Dingen nicht wirklich.


    Michael

    Einmal editiert, zuletzt von lwl2011Bochum (20. Oktober 2011 um 19:40)

  • Du hast dir die Hilfe zu Tabs nicht wirklich durchgelesen oder?^^
    Bin grad schnell drüber geflogen:

    [autoit]

    GUICtrlSetState($tabitemID, $GUI_SHOW);

    [/autoit]


    $tabitemID = Id des TabItemControls welches du anzeigen willst.

    [autoit]

    $nameTabItem = GUICtrlRead($tab)

    [/autoit]


    $tab = das TabControl einfach.

    Am besten du schaust dir das selbst nochmal an. Hier der Ganze Code aus der Hilfe.

    Spoiler anzeigen
    [autoit]

    #include <GUIConstantsEx.au3>

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

    Opt('MustDeclareVars', 1)

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

    Example()

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

    Func Example()
    Local $tab, $tab0, $tab0OK, $tab0input
    Local $tab1, $tab1combo, $tab1OK
    Local $tab2, $tab2OK, $msg

    GUICreate("My GUI Tab", 250, 150); will create a dialog box that when displayed is centered

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

    GUISetBkColor(0x00E0FFFF)
    GUISetFont(9, 300)

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

    $tab = GUICtrlCreateTab(10, 10, 200, 100)

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

    $tab0 = GUICtrlCreateTabItem("tab0")
    GUICtrlCreateLabel("label0", 30, 80, 50, 20)
    $tab0OK = GUICtrlCreateButton("OK0", 20, 50, 50, 20)
    $tab0input = GUICtrlCreateInput("default", 80, 50, 70, 20)

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

    $tab1 = GUICtrlCreateTabItem("tab----1")
    GUICtrlCreateLabel("label1", 30, 80, 50, 20)
    $tab1combo = GUICtrlCreateCombo("", 20, 50, 60, 120)
    GUICtrlSetData(-1, "Trids|CyberSlug|Larry|Jon|Tylo", "Jon"); default Jon
    $tab1OK = GUICtrlCreateButton("OK1", 80, 50, 50, 20)

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

    $tab2 = GUICtrlCreateTabItem("tab2")
    GUICtrlSetState($tab0, $GUI_SHOW); will be display first
    GUICtrlCreateLabel("label2", 30, 80, 50, 20)
    $tab2OK = GUICtrlCreateButton("OK2", 140, 50, 50)

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

    GUICtrlCreateTabItem(""); end tabitem definition

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

    GUICtrlCreateLabel("Click on tab and see the title", 20, 130, 250, 20)

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

    GUISetState()

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

    ; Run the GUI until the dialog is closed
    While 1
    $msg = GUIGetMsg()

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

    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    If $msg = $tab Then
    ; display the clicked tab
    WinSetTitle("My GUI Tab", "", "My GUI Tab" & GUICtrlRead($tab))
    EndIf
    WEnd
    EndFunc ;==>Example

    [/autoit]
  • Hallo ,

    schau dir dazu

    [autoit]

    _GUICtrlTab_SetCurSel

    [/autoit]

    und

    [autoit]

    _GUICtrlTab_GetItemText

    [/autoit]

    an.

    Spoiler anzeigen
    [autoit]

    #AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
    #include <GuiConstantsEx.au3>
    #include <GuiTab.au3>

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

    Opt('MustDeclareVars', 1)

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

    $Debug_TAB = False ; Check ClassName being passed to functions, set to True and use a handle to another control to see it work

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

    _Main()

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

    Func _Main()
    Local $hTab

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

    ; Create GUI
    GUICreate("Tab Control Set Current Selected", 400, 300)
    $hTab = GUICtrlCreateTab(2, 2, 396, 296)
    GUISetState()

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

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

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

    ; Get/Set current selection
    _GUICtrlTab_SetCurSel($hTab, 2)
    MsgBox(4160, "Information", "Current Selection: " & _GUICtrlTab_GetCurSel($hTab) & @CRLF &@CRLF & _GUICtrlTab_GetItemText ($hTab,_GUICtrlTab_GetCurSel($hTab)))

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

    ; Loop until user exits
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
    GUIDelete()
    EndFunc ;==>_Main

    [/autoit]

    mfg autoBert

    mfg autoBert