Earl Posted May 29, 2008 Posted May 29, 2008 Hey, I need to be able to close a form that is opened by a button in the main form. I tried Setstate hide and It would hide the form, but then, nothing would respond.
enaiman Posted May 30, 2008 Posted May 30, 2008 GuiDelete($your_new_form_handle) SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script wannabe "Unbeatable" Tic-Tac-Toe Paper-Scissor-Rock ... try to beat it anyway :)
Earl Posted May 30, 2008 Author Posted May 30, 2008 (edited) Thanks Nevermind, same problem. Buttons won't respond. Sorry I forgot. Here is the script #include <GUIConstants.au3> #Region ### START Koda GUI section ### Form=c:\documents and settings\alex\my documents\scripts\startrek\v3 holo version\mm.kxf $Form1_1 = GUICreate("Main Menu", 791, 502, 197, 114, BitOR($WS_MINIMIZEBOX,$WS_DLGFRAME,$WS_GROUP,$WS_CLIPSIBLINGS)) GUISetBkColor(0x000000) $Button1 = GUICtrlCreateButton("Storyline", 0, 40, 201, 49, 0) $Button3 = GUICtrlCreateButton("Sandbox", 21, 98, 169, 57, 0) $Button4 = GUICtrlCreateButton("Exit", 48, 160, 97, 49, 0) $Label1 = GUICtrlCreateLabel("Star Trek V3", 8, 0, 185, 41) GUICtrlSetFont(-1, 24, 400, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0x0000FF) $Pic1 = GUICtrlCreatePic("C:\Documents and Settings\Alex\My Documents\Scripts\StarTrek\V3 holo version\ed-corridor-st7.jpg", 240, 0, 546, 495, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)) $Tab1 = GUICtrlCreateTab(8, 232, 217, 97) GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT) $TabSheet1 = GUICtrlCreateTabItem("Storyline") $Button2 = GUICtrlCreateButton("text", 24, 264, 65, 41, 0) $Button5 = GUICtrlCreateButton("sound", 104, 264, 113, 49, 0) $TabSheet2 = GUICtrlCreateTabItem("Sandbox") $Button6 = GUICtrlCreateButton("text", 24, 264, 97, 49, 0) $Button7 = GUICtrlCreateButton("sound", 136, 264, 73, 41, 0) $TabSheet3 = GUICtrlCreateTabItem("Credits") $Button8 = GUICtrlCreateButton("Credits", 16, 264, 201, 49, 0) GUICtrlCreateTabItem("") $Pic2 = GUICtrlCreatePic("C:\Documents and Settings\Alex\My Documents\Scripts\StarTrek\V3 holo version\images.jpg", 16, 344, 148, 119, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 Case $Button3 $Form1_1 = GUICreate("Main Bridge", 544, 639, 318, 120) GUISetBkColor(0xFFFFFF) $Pic1 = GUICtrlCreatePic("C:\Documents and Settings\Alex\My Documents\Scripts\StarTrek\V3 holo version\entdbridge2.jpg", 0, 0, 539, 636, $WS_CLIPSIBLINGS) $button1 = GUICtrlCreateButton("Speed", 264, 224, 41, 17) $Button2 = GUICtrlCreateButton("Ops", 176, 224, 41, 17) $Button3 = GUICtrlCreateButton("Tactical", 216, 456, 49, 17) $Button4 = GUICtrlCreateButton("Science", 304, 576, 49, 17) $Button5 = GUICtrlCreateButton("Sensors", 240, 592, 49, 17, 0) $Button6 = GUICtrlCreateButton("Personell", 176, 592, 49, 17, 0) $Button7 = GUICtrlCreateButton("Engines", 120, 568, 49, 17, 0) $Button8 = GUICtrlCreateButton("Ready-Room", 0, 152, 73, 25, 0) $Button9 = GUICtrlCreateButton("Viewscreen", 200, 56, 89, 33, 0) $Button10 = GUICtrlCreateButton("Observation Room", 416, 576, 97, 33, 0) $Button11 = GUICtrlCreateButton("B. Bridge", 400, 192, 57, 17, 0) $Radio1 = GUICtrlCreateRadio("Green", 472, 40, 57, 25) $Radio2 = GUICtrlCreateRadio("Yellow", 472, 64, 57, 17) $Radio3 = GUICtrlCreateRadio("Red", 472, 80, 57, 17) $Label1 = GUICtrlCreateLabel("Alert", 488, 16, 25, 17) $Input1 = GUICtrlCreateInput("Green", 72, 8, 153, 32) GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif") $Label2 = GUICtrlCreateLabel("Captain", 0, 8, 67, 28) GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif") $Button12 = GUICtrlCreateButton("Turbolift", 16, 520, 57, 25, $WS_CLIPSIBLINGS) $Button13 = GUICtrlCreateButton("Turbolift", 464, 448, 65, 25, 0) $Button14 = GUICtrlCreateButton("Turbolift", 0, 232, 49, 25, 0) GUISetState(@SW_SHOW) #endregion ### START Koda GUI section ### Form=c:\documents and settings\alex\my documents\scripts\startrek\v3 holo version\main bridge.kxf While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE GUIDelete() Case $button1 Case $Button2 Case $Button3 Case $Button4 Case $Button5 Case $Button6 Case $Button8 MsgBox(4096, "Credits", "I wrote the program using Autoit v3. Pictures and sounds found on the internet. Star Trek is a registered trademark of paramount pic") Case $Button9 Case $Button10 Case $Button11 Case $Radio1 Case $Radio2 Case $Radio3 Case $Button12 Case $Button13 EndSwitch WEnd Case $Button4 Exit Case $Button2 Case $Button5 Case $Button6 Case $Button7 Case $Button8 Case $Pic2 EndSwitch WEnd Edited May 30, 2008 by Earl
mysterious Posted May 30, 2008 Posted May 30, 2008 (edited) Try, expandcollapse popup#include <GUIConstants.au3> #Region ### START Koda GUI section ### Form=c:\documents and settings\alex\my documents\scripts\startrek\v3 holo version\mm.kxf $Form1_1 = GUICreate("Main Menu", 791, 502, 197, 114, BitOR($WS_MINIMIZEBOX,$WS_DLGFRAME,$WS_GROUP,$WS_CLIPSIBLINGS)) GUISetBkColor(0x000000) $Button1 = GUICtrlCreateButton("Storyline", 0, 40, 201, 49, 0) $Button3 = GUICtrlCreateButton("Sandbox", 21, 98, 169, 57, 0) $Button4 = GUICtrlCreateButton("Exit", 48, 160, 97, 49, 0) $Label1 = GUICtrlCreateLabel("Star Trek V3", 8, 0, 185, 41) GUICtrlSetFont(-1, 24, 400, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0x0000FF) $Pic1 = GUICtrlCreatePic("C:\Documents and Settings\Alex\My Documents\Scripts\StarTrek\V3 holo version\ed-corridor-st7.jpg", 240, 0, 546, 495, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)) $Tab1 = GUICtrlCreateTab(8, 232, 217, 97) GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT) $TabSheet1 = GUICtrlCreateTabItem("Storyline") $Button2 = GUICtrlCreateButton("text", 24, 264, 65, 41, 0) $Button5 = GUICtrlCreateButton("sound", 104, 264, 113, 49, 0) $TabSheet2 = GUICtrlCreateTabItem("Sandbox") $Button6 = GUICtrlCreateButton("text", 24, 264, 97, 49, 0) $Button7 = GUICtrlCreateButton("sound", 136, 264, 73, 41, 0) $TabSheet3 = GUICtrlCreateTabItem("Credits") $Button8 = GUICtrlCreateButton("Credits", 16, 264, 201, 49, 0) GUICtrlCreateTabItem("") $Pic2 = GUICtrlCreatePic("C:\Documents and Settings\Alex\My Documents\Scripts\StarTrek\V3 holo version\images.jpg", 16, 344, 148, 119, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 MsgBox(0,"Storyline","Storyline button : Works!") Case $Button2 MsgBox(0,"Text","You clicked the 'text' button under 'Storyline'") Case $Button4 Exit Case $Button5 MsgBox(0,"Sound","You clicked the 'sound' button under 'Storyline'") Case $Button6 MsgBox(0,"Text","You clicked the 'text' button under 'Sandbox'") Case $Button7 MsgBox(0,"Sound","You clicked the 'sound' button under 'Sandbox'") Case $Button8 MsgBox(0,"Credits","I wrote the program using Autoit v3. Pictures and sounds found on the internet. Star Trek is a registered trademark of paramount pic") Case $Button3 $Form1_1 = GUICreate("Main Bridge", 544, 639, 318, 120) GUISetBkColor(0xFFFFFF) $Pic1 = GUICtrlCreatePic("C:\Documents and Settings\Alex\My Documents\Scripts\StarTrek\V3 holo version\entdbridge2.jpg", 0, 0, 539, 636, $WS_CLIPSIBLINGS) $button1 = GUICtrlCreateButton("Speed", 264, 224, 41, 17) $Button2 = GUICtrlCreateButton("Ops", 176, 224, 41, 17) $Button3 = GUICtrlCreateButton("Tactical", 216, 456, 49, 17) $Button4 = GUICtrlCreateButton("Science", 304, 576, 49, 17) $Button5 = GUICtrlCreateButton("Sensors", 240, 592, 49, 17, 0) $Button6 = GUICtrlCreateButton("Personell", 176, 592, 49, 17, 0) $Button7 = GUICtrlCreateButton("Engines", 120, 568, 49, 17, 0) $Button8 = GUICtrlCreateButton("Ready-Room", 0, 152, 73, 25, 0) $Button9 = GUICtrlCreateButton("Viewscreen", 200, 56, 89, 33, 0) $Button10 = GUICtrlCreateButton("Observation Room", 416, 576, 97, 33, 0) $Button11 = GUICtrlCreateButton("B. Bridge", 400, 192, 57, 17, 0) $Radio1 = GUICtrlCreateRadio("Green", 472, 40, 57, 25) $Radio2 = GUICtrlCreateRadio("Yellow", 472, 64, 57, 17) $Radio3 = GUICtrlCreateRadio("Red", 472, 80, 57, 17) $Label1 = GUICtrlCreateLabel("Alert", 488, 16, 25, 17) $Input1 = GUICtrlCreateInput("Green", 72, 8, 153, 32) GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif") $Label2 = GUICtrlCreateLabel("Captain", 0, 8, 67, 28) GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif") $Button12 = GUICtrlCreateButton("Turbolift", 16, 520, 57, 25, $WS_CLIPSIBLINGS) $Button13 = GUICtrlCreateButton("Turbolift", 464, 448, 65, 25, 0) $Button14 = GUICtrlCreateButton("Turbolift", 0, 232, 49, 25, 0) GUISetState(@SW_SHOW) #endregion ### START Koda GUI section ### Form=c:\documents and settings\alex\my documents\scripts\startrek\v3 holo version\main bridge.kxf While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE GUIDelete($Form1_1) Case $button1 MsgBox(0,"Speed","Speed button : Works!") ; Change to what ever you want it to do.. Case $Button2 MsgBox(0,"Ops","Ops button : Works!") ; Change to what ever you want it to do.. Case $Button3 MsgBox(0,"Tactical","Tactical button : Works!") ; Change to what ever you want it to do.. Case $Button4 MsgBox(0,"Science","Science button : Works!") ; Change to what ever you want it to do.. Case $Button5 MsgBox(0,"Sensors","Sensors button : Works!") ; Change to what ever you want it to do.. Case $Button6 MsgBox(0,"Pesonell","Personell button : Works!") ; Change to what ever you want it to do.. Case $Button7 MsgBox(0,"Engines","Engines button : Works!") ; Change to what ever you want it to do.. Case $Button8 MsgBox(4096, "Ready-Room", "Ready-Room button : Works!") ; Change to what ever you want it to do.. Case $Button9 MsgBox(0,"View Screen","View Screen button : Works!") ; Change to what ever you want it to do.. Case $Button10 MsgBox(0,"Observation Room","Observation Room button : Works!") ; Change to what ever you want it to do.. Case $Button11 MsgBox(0,"B. Bridge","B. Bridge button : Works!") ; Change to what ever you want it to do.. Case $Radio1 MsgBox(0,"Green"," Green Radio : Works!") ; Change to what ever you want it to do.. Case $Radio2 MsgBox(0,"Yellow","Yellow Radio : Works!") ; Change to what ever you want it to do.. Case $Radio3 MsgBox(0,"Red","Red Radio : Works!") ; Change to what ever you want it to do.. Case $Button12, $Button13, $Button14 MsgBox(0,"Turbolift","Turbolift button : Works!") ; Change to what ever you want it to do.. EndSwitch WEnd EndSwitch WEnd Did the best I could, was pressed for time.. Good luck! Edited May 30, 2008 by mysterious [center]Class... Now in session ( Thanks to Valuater )Not much more you need to know. ^_^[/center]
Earl Posted June 7, 2008 Author Posted June 7, 2008 Sorry guys, I was at summer camp, and I haven't been able to try it. But it should probably do the trick. By the way, if anyone still wants to post their solutions, Iv could try them two/too/to .
Earl Posted July 28, 2008 Author Posted July 28, 2008 Okay, I'm sorry. I completely forgot about my game.
AdmiralAlkex Posted July 28, 2008 Posted July 28, 2008 You never exit the second loop. Use ExitLoop .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
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