KANlFUSA Posted August 20, 2015 Posted August 20, 2015 (edited) Please help mehow to edit , after click OK msgbox "finish" , gui (GUICtrlCreateProgress(235, 198, 333, 3) and Guictrlcreatelabel("",235,198,333,1,0x01) will disappear. after that click back START button can rerun again? expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ButtonConstants.au3> #Region ### START Koda GUI section ### Form= Global $Form1 = GUICreate("Form1", 806, 456, -1, -1) Global $Button1 = GUICtrlCreateButton("START", 313, 144, 80, 38, $BS_CENTER) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 pbar() EndSwitch WEnd Func pbar() $progressbar = GUICtrlCreateProgress(235, 198, 333, 3) $label = Guictrlcreatelabel("",235,198,333,1,0x01) Guictrlsetbkcolor(-1, $GUI_BKCOLOR_TRANSPARENT) GUISetState() local $progressbar local $i = 0 While Guigetmsg() <> -1 $i = $i+2 GUICtrlSetData($progressbar, $i) GUICtrlSetData($label,$i) Sleep(1) If $i = 100 then msgfinish() WEnd EndFunc Func msgfinish() MsgBox(0,"Finish","Finish","") If @Error = 1 then Exit Endif Return EndFunc Edited August 31, 2015 by KANlFUSA
mikell Posted August 20, 2015 Posted August 20, 2015 (edited) If you want to make controls disappear/reappear, the best way is to show/hide themYou need also to take care to exit loop when you're doneexpandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ButtonConstants.au3> Global $Form1 = GUICreate("Form1", 806, 456, -1, -1) Global $Button1 = GUICtrlCreateButton("START", 313, 144, 80, 38, $BS_CENTER) $progressbar = GUICtrlCreateProgress(235, 198, 333, 3) GUICtrlSetState(-1, $GUI_HIDE) $label = Guictrlcreatelabel("",235,198,333,1,0x01) Guictrlsetbkcolor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetState(-1, $GUI_HIDE) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 pbar() EndSwitch WEnd Func pbar() GUICtrlSetState($progressbar, $GUI_SHOW) GUICtrlSetState($label, $GUI_SHOW) local $i = 0 While Guigetmsg() <> $GUI_EVENT_CLOSE $i = $i+2 GUICtrlSetData($progressbar, $i) GUICtrlSetData($label,$i) Sleep(1) If $i = 100 then Exitloop WEnd msgfinish() EndFunc Func msgfinish() MsgBox(0,"Finish","Finish","") GUICtrlSetState($progressbar, $GUI_HIDE) GUICtrlSetState($label, $GUI_HIDE) EndFunc Edited August 20, 2015 by mikell KANlFUSA 1
KANlFUSA Posted August 21, 2015 Author Posted August 21, 2015 Thank you very much to mikell, everything fine now
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