apex52 Posted May 1, 2012 Posted May 1, 2012 How can I create a simple gui box with a button which when pressed changes the gui without launching an entirely new one, like if I wanted to add a new button or change what the original button said. Similar to the way a installer works when navigating through the menu's. Thanks.
water Posted May 1, 2012 Posted May 1, 2012 What have you coded so far? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Zedna Posted May 1, 2012 Posted May 1, 2012 GUICtrlSetData() Resources UDF ResourcesEx UDF AutoIt Forum Search
guinness Posted May 1, 2012 Posted May 1, 2012 How about something like this? A little technical for someone who is new to AutoIt, but you get the point. expandcollapse popup#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #include <GUIConstantsEx.au3> #include <TabConstants.au3> Example() Func Example() Local $aArray[11] = [10], $hGUI, $iBack, $iHeight = 500, $iIndex = 0, $iNext, $iTab, $iWidth = 500 $hGUI = GUICreate("", $iWidth, $iHeight) $iBack = GUICtrlCreateButton("Back", $iWidth - 180, $iHeight - 30, 85, 25) $iNext = GUICtrlCreateButton("Next", $iWidth - 90, $iHeight - 30, 85, 25) $iTab = GUICtrlCreateTab(-99, -99, 0, 0) ; Create a Tab group. For $i = 1 To $aArray[0] GUICtrlCreateTabItem($i) GUICtrlCreateLabel('Page ' & $i, 10, 10) Next GUICtrlCreateTabItem("") ; Close the Tab group. _Toggle_EnableOrDisable($iBack, 0) ; Disable the back button. GUISetState(@SW_SHOW, $hGUI) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $iBack If $iIndex = ($aArray[0] - 1) Then ; Enabled the next button if the index is currently at the maximum number of tabs minus 1. _Toggle_EnableOrDisable($iNext, 1) ; Enable the next button. EndIf $iIndex -= 1 ; Decrease the item index. If $iIndex <= 0 Then ; Disable the back button if the index is less than the number of tab items. $iIndex = 0 _Toggle_EnableOrDisable($iBack, 0) ; Disable the back button. EndIf GUICtrlSendMsg($iTab, $TCM_SETCURFOCUS, $iIndex, 0) Case $iNext $iIndex += 1 ; Increase the item index. If $iIndex = 1 Then _Toggle_EnableOrDisable($iBack, 1) ; Enable the back button if the index is equal to 1. EndIf If $iIndex >= ($aArray[0] - 1) Then ; Disable the next button if the index is greater than the number of tab items minus 1. $iIndex = ($aArray[0] - 1) _Toggle_EnableOrDisable($iNext, 0) ; Disable the next button. EndIf GUICtrlSendMsg($iTab, $TCM_SETCURFOCUS, $iIndex, 0) EndSwitch WEnd EndFunc ;==>Example Func _Toggle_EnableOrDisable($iControlID, $iOverride = -1) ; By guinness. Local $aState[2] = [$GUI_ENABLE, $GUI_DISABLE] If $iOverride > -1 Then $iOverride = Number(Not $iOverride) Else $iOverride = Number(BitAND(GUICtrlGetState($iControlID), $aState[0]) = $aState[0]) EndIf GUICtrlSetState($iControlID, $aState[$iOverride]) EndFunc ;==>_Toggle_EnableOrDisable UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018
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