Buckw1 Posted July 5, 2006 Posted July 5, 2006 I want to be able to switch to another tab if some event occurs. Modded the help file but can't get the tabs to change, whats wrong? expandcollapse popup#include <GUIConstants.au3> #include <GuiTab.au3> opt('MustDeclareVars', 1) Dim $tab, $tab0, $tab1 Dim $msg, $button, $item = 0, $i GUICreate("Tab Set Current Focus", 300, 200) ; will create a dialog box that when displayed is centered GUISetBkColor(0x00E0FFFF) GUISetFont(9, 300) $tab = GUICtrlCreateTab(10, 10, 200, 100) $tab0 = GUICtrlCreateTabItem("tab0") GUICtrlCreateTabItem(""); end tabitem definition $tab1 = GUICtrlCreateTabItem("tab1") GUICtrlSetState(-1, $GUI_SHOW); will be display first GUICtrlCreateTabItem(""); end tabitem definition $button = GUICtrlCreateButton("Set", 200, 130, 90, 30) GUISetState() ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $button _GUICtrlTabSetCurSel ($tab0, $item) _GUICtrlTabSetCurFocus ($tab0, $item) $item = Not $item EndSelect WEnd
Xenobiologist Posted July 5, 2006 Posted July 5, 2006 HI, expandcollapse popup#include <GUIConstants.au3> #include <GuiTab.au3> opt('MustDeclareVars', 1) Dim $tab, $tab0, $tab1 Dim $msg, $button, $item = 0, $i GUICreate("Tab Set Current Focus", 300, 200) ; will create a dialog box that when displayed is centered GUISetBkColor(0x00E0FFFF) GUISetFont(9, 300) $tab = GUICtrlCreateTab(10, 10, 200, 100) $tab0 = GUICtrlCreateTabItem("tab0") GUICtrlCreateTabItem(""); end tabitem definition $tab1 = GUICtrlCreateTabItem("tab1") GUICtrlSetState(-1, $GUI_SHOW); will be display first GUICtrlCreateTabItem(""); end tabitem definition $button = GUICtrlCreateButton("Set", 200, 130, 90, 30) GUISetState() ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $button ;_GUICtrlTabSetCurSel($tab1, $item) _GUICtrlTabSetCurFocus($tab, $item) $item = Not $item EndSelect WEnd So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times
Buckw1 Posted July 5, 2006 Author Posted July 5, 2006 HI, ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $button ;_GUICtrlTabSetCurSel($tab1, $item) _GUICtrlTabSetCurFocus($tab, $item) $item = Not $item EndSelect WEnd So long, Mega Ok, $tab is like index name an $item is tab number to be selected? Works great now, thanks!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now