Emerica Posted May 2, 2006 Share Posted May 2, 2006 (edited) Im looking for a gui object destroy command or something similar. I've been messing with another application I am working on which loaded different media players. The problem i am running into is that I cant seem to remove the player once loaded. So additionnal players just overlap. Here is an examle using a button. #include <GUIConstants.au3> ; == GUI generated with Koda == $loaded = False $Form1 = GUICreate("AForm1", 300, 340, 192, 125) $Button2 = GUICtrlCreateButton("Load / Unload", 104, 256, 75, 25) GUISetState(@SW_SHOW) While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button2 onoff() Case Else ;;;;;;; EndSelect WEnd Exit Func onoff() If $loaded ==False Then $Button1 = 0 $Button1 = GUICtrlCreateButton("AButton1", 64, 24, 169, 81) $loaded=True ElseIf $loaded ==True Then $Button1 = 0 ;;WHY WONT IT GO AWAY! $loaded = False EndIf EndFunc Edited May 2, 2006 by Emerica Project X Network StreamDrive Link to comment Share on other sites More sharing options...
greenmachine Posted May 2, 2006 Share Posted May 2, 2006 GUIDelete($Form1)? GUISetState(@SW_HIDE)? Link to comment Share on other sites More sharing options...
Valuater Posted May 2, 2006 Share Posted May 2, 2006 maybe #include <GUIConstants.au3> ; == GUI generated with Koda == Dim $AButton1 $loaded = False $Form1 = GUICreate("AForm1", 300, 340, 192, 125) $Button2 = GUICtrlCreateButton("Load / Unload", 104, 256, 75, 25) GUISetState(@SW_SHOW) While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button2 onoff() Case Else ;;;;;;; EndSelect WEnd Exit Func onoff() If $loaded ==False Then $Button1 = 0 $AButton1 = GUICtrlCreateButton("AButton1", 64, 24, 169, 81) $loaded=True ElseIf $loaded ==True Then $Button1 = 0 GUICtrlDelete($AButton1) ;;WHY WONT IT GO AWAY! $loaded = False EndIf EndFunc 8) Link to comment Share on other sites More sharing options...
Emerica Posted May 2, 2006 Author Share Posted May 2, 2006 Ok.. I went for a walk around the building... and you guys made it happen. Kudos! Now to apply that to the media player Thanks. Project X Network StreamDrive 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