vickerps Posted May 24, 2006 Posted May 24, 2006 Hi i am currently writing a script that has several form which are accessed back and forth via a back and next button on each i have created this but im sure im doing a messy way is can anyone give me help. I look at that autoit 123 which does what im after but i can not look at the source code. The decompiler doesn't work. Here what i have done so far expandcollapse popup#INCLUDE <Process.au3> #INCLUDE <File.au3> #INCLUDE <GUIConstants.au3> Opt("GUICoordMode",1) $Firstwindow = GuiCreate("Firstwindow",530,300,-1,-1,$WS_SYSMENU+$WS_MINIMIZEBOX,$WS_EX_TOPMOST) GUISetState(@SW_SHOW) $Next1 = GUICtrlCreateButton("Next",400,225,120,40) GUICtrlSetState(-1,$GUI_FOCUS) GUISetState(@SW_SHOW) ; ----------------------------------------------------------------------------------------------------------------------- ; - ; ----------------------------------------------------------------------------------------------------------------------- Opt("GUICoordMode",1) $Secondwindow = GuiCreate("Secondwindow",530,300,-1,-1,$WS_SYSMENU+$WS_MINIMIZEBOX,$WS_EX_TOPMOST) $back1 = GUICtrlCreateButton("Back",280,225,120,40) $Next2 = GUICtrlCreateButton("Next",400,225,120,40) ; ----------------------------------------------------------------------------------------------------------------------- ; - ; ----------------------------------------------------------------------------------------------------------------------- Opt("GUICoordMode",1) $Thirdwindow = GuiCreate("Thirdwindow",530,300,-1,-1,$WS_SYSMENU+$WS_MINIMIZEBOX,$WS_EX_TOPMOST) $back2 = GUICtrlCreateButton("Back",280,225,120,40) $Finish= GUICtrlCreateButton("Finish",400,225,120,40) ; ----------------------------------------------------------------------------------------------------------------------- ; - onEvent queries ; ----------------------------------------------------------------------------------------------------------------------- ; ----------------------------------------------------------------------------------------------------------------------- ; - onEvent queries when user press a button of menu button ; ----------------------------------------------------------------------------------------------------------------------- WHILE 1 $Msg=GUIGetMsg() SELECT Case $msg = $Next1 GUISwitch($Secondwindow) GUISetState(@SW_SHOW) GUISwitch($Firstwindow) GUISetState (@SW_HIDE) Case $msg = $Next2 GUISwitch($Thirdwindow) GUISetState(@SW_SHOW) GUISwitch($Secondwindow) GUISetState (@SW_HIDE) Case $msg = $back1 GUISwitch($Firstwindow) GUISetState (@SW_SHOW) GUISwitch($Secondwindow) GUISetState(@SW_HIDE) Case $msg = $back2 GUISwitch($Secondwindow) GUISetState (@SW_SHOW) GUISwitch($Thirdwindow) GUISetState(@SW_HIDE) Case $msg = $GUI_EVENT_CLOSE EXIT Case $msg = $Finish GUISwitch($Thirdwindow) GUISetState(@SW_HIDE) ExitLoop EndSelect WEnd msgbox(0,"Finished","Bye")
CoderDunn Posted May 25, 2006 Posted May 25, 2006 (edited) If I wasn't at school I'd provide a example but here are some pointers. 1. You could just put all the controls on the same GUI and hide/unhide those with GuiCtrlSetState() 2. Instead of using GuiSwitch() so much you could do for example, GUISetState(@SW_SHOW,$Firstwindow) Hallman Edited May 25, 2006 by Hallman
vickerps Posted May 26, 2006 Author Posted May 26, 2006 If I wasn't at school I'd provide a example but here are some pointers.1. You could just put all the controls on the same GUI and hide/unhide those with GuiCtrlSetState()2. Instead of using GuiSwitch() so much you could do for example, GUISetState(@SW_SHOW,$Firstwindow)HallmanThank for the reply. I don't think point 1 is pratical seeing for amount of controls i would be using. I will give point 2 ago never thought of doing it that way thanks. What i am trying to achieve with the multiple forms is somthing like a sysprep utility. Autoit 1-2-3 uses the method i am trying to do on the "Scripts and Scraps" page.
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