Clay Posted May 12, 2008 Share Posted May 12, 2008 (edited) How can I close a GUI by my own will...meaning that I have created a button and once that button is pressed -> I want to run a few processes -> Then I want the GUI to disappear once the processes under that button have completed -> Then move on to the rest of my script I have tried using the $GUI_EVENT_CLOSE .. but that didn't work, and I have tried GUISetState(@WS_HIDE), but that didn't work either. I have tried a few other things that gave me no results. I know that is a simple thing to do but I just can't seem to get what I want so jsut wondering it anyone knows what function I should use. Help! Here is some code expandcollapse popupLocal $PWVD Local $Label1 Local $Label2 Local $Products Local $ProdVerions Local $Download Local $AProduct Local $tmp Local $getSelect Global $DResult Global $DevFile Global $GuiResults[2] Dim $fileSplitArray[2] Dim $FindExe, $szDrive, $szDir, $szFName, $szExt Func Gui() $PWVD = GUICreate("PWVD DevCentral Download Interface", 382, 122, 313, 210) GUISetBkColor(0xD4D0C8) $Label1 = GUICtrlCreateLabel("Select a Product ", 32, 16, 110, 17) $Label2 = GUICtrlCreateLabel("Select a Version", 232, 16, 99, 17) $Products = GUICtrlCreateCombo("", 32, 40, 121, 25) $ProdVerions = GUICtrlCreateCombo("", 232, 40, 73, 25) $Download = GUICtrlCreateButton("Download", 136, 80, 97, 25, 0) GUISetState(@SW_SHOW) $AProduct = getDownload() For $i = 0 To Ubound($AProduct)-1 $tmp &= $AProduct[$i]& "|" Next $tmp = StringTrimRight($tmp,1) GUICtrlSetData($Products,$tmp) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Label1 Case $Products Case $ProdVerions Case $Download $getSelect = GUICtrlRead(($Products)) $DevFile = fileSplit($getSelect) ;$DResult = True ;$GuiResults[0] = $DevFile ;$GuiResults[1] = $DResult Return $DevFile EndSwitch WEnd EndFunc Edited May 12, 2008 by Clay Link to comment Share on other sites More sharing options...
monoceres Posted May 12, 2008 Share Posted May 12, 2008 (edited) How can I close a GUI by my own will...meaning that I have created a button and once that button is pressed -> I want to run a few processes -> Then I want the GUI to disappear once the processes under that button have completed -> Then move on to the rest of my scriptI have tried using the $GUI_EVENT_CLOSE .. but that didn't work, and I have tried GUISetState(@WS_HIDE), but that didn't work either. I have tried a few other things that gave me no results. I know that is a simple thing to do but I just can't seem to get what I want so jsut wondering it anyone knows what function I should use. Help!GUIDelete() Or GUISetState(@SW_HIDE) Edit: Also make sure the GUI is "activated" with GUISwitch. Edited May 12, 2008 by monoceres Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
Clay Posted May 12, 2008 Author Share Posted May 12, 2008 Momoceres, Thanks for you help, but GUISetState(@SW_HIDE) or GUIDelete() don't seem to work at all. Link to comment Share on other sites More sharing options...
monoceres Posted May 12, 2008 Share Posted May 12, 2008 I tested some and I have no problems with GUIDelete, you did pass $PWVD to it?: GUIDelete($PWVD) Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
Clay Posted May 12, 2008 Author Share Posted May 12, 2008 I did... placed it under the $Download Button since I want it to be executed under that button ... .but still nothing Link to comment Share on other sites More sharing options...
monoceres Posted May 12, 2008 Share Posted May 12, 2008 I did... placed it under the $Download Button since I want it to be executed under that button ... .but still nothingMost likely it's never even executed. Try using OnEvent code instead, it's much easier to debug. Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
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