Info Posted March 7, 2008 Share Posted March 7, 2008 My child GUI: $LogGUI = GUICreate("View Log", 224, 114, 400, 300, -1, BitOR($WS_EX_TOOLWINDOW,$WS_EX_WINDOWEDGE)) GUISetBkColor (0x000000) $LogEdit = GUICtrlCreateEdit("", 0, 0, 153, 113, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_READONLY,$ES_WANTRETURN), BitOR($WS_EX_CLIENTEDGE,$WS_EX_STATICEDGE)) GUICtrlSetBkColor ($LogEdit, 0xFFFFFF);Enter background color here That's my While: While 1; MAIN GUI $msg = GUIGetMsg(); MAIN GUI Select; MAIN GUI Case $msg = $GUI_EVENT_CLOSE; MAIN GUI Exit; MAIN GUI Case $msg = $LogButton; CHILD GUI GUISetState(@SW_SHOW, $LogGUI); CHILD GUI The problem is that when I press on the 'X' in my child GUI, it exits from the main GUI too... I want it to exit only from the child GUI... I tried: Case $msg = $LogButton GUISetState(@SW_SHOW, $LogGUI) Case $msg = $GUI_EVENT_CLOSE GUISetState(@SW_HIDE, $LogGUI) And: Case $msg = $LogButton GUISetState(@SW_SHOW, $LogGUI) Case $msg = $GUI_EVENT_CLOSE GUISetState(@SW_DISABLE, $LogGUI) And: Case $msg = $LogButton GUISetState(@SW_SHOW, $LogGUI) Case $msg = $GUI_EVENT_CLOSE GUIDelete($LogGUI) And nothing worked... Help me please Link to comment Share on other sites More sharing options...
kjactive Posted March 7, 2008 Share Posted March 7, 2008 (edited) Hallo Info A small main and a child gui example would be something like this #include <GUIConstants.au3> $MainWin = GUICreate('MainWindow', 420, 350, -1, -1) GUISetState(@SW_SHOW,$MainWin) $ChildWin = GUICreate('Childwindow', 220, 250, 10, 10,-1, $WS_EX_MDICHILD,$MainWin) GUISetState(@SW_SHOW,$ChildWin) While 1 $msg = GUIGetMsg(1) Select Case $msg[1] = $MainWin If $msg[0] = -3 Then ExitLoop Case $msg[1] = $ChildWin If $msg[0] = -3 Then GUIDelete($ChildWin) EndSelect WEnd exit kjactive Edited March 7, 2008 by kjactive Au3PP 4.1 - Autoit3 preprocessor, optimize speed, performance to scripts and do executes....[/url]Au3Calibur - Create libraries of commonly used code excerptsWords manipulate UDF, functions that is lent from the rexx language, topics and index file includedCustomDialog UDF to include custom made dialogs like a extended colorpick requester to scripts...[url="ftp://fritidshjemmet.com/Autoit3/SysColor.zip"]SysColor UDF a low level color library to manipulate RGB and Hex values...Shell32 UDF to Automate Windows® operating tasks from native dialog and Wizards browsers... Optimized the CodeWicard with options to generate browser code etc... Link to comment Share on other sites More sharing options...
Info Posted March 7, 2008 Author Share Posted March 7, 2008 (edited) I have more buttons in my main GUI... I tried to replace their $msg in $msg[1] and it's not working... Edited March 7, 2008 by Info Link to comment Share on other sites More sharing options...
Info Posted March 7, 2008 Author Share Posted March 7, 2008 UP I'll shut up for the next year I swear T_T Link to comment Share on other sites More sharing options...
rasim Posted March 8, 2008 Share Posted March 8, 2008 Hi! You neede this?: #include <GuiConstants.au3> $MainGui = GuiCreate("Main GUI", 400, 300) $LogButton = GUICtrlCreateButton("Switch", 10, 270, 60, 25) $ChildGui = GUICreate("Child GUI", 300, 200, -1, -1, -1, -1, $MainGui) GUISetState(@SW_SHOW, $MainGui) While 1 $msg = GUIGetMsg(1) Select Case $msg[0] = $GUI_EVENT_CLOSE And $msg[1] = $MainGui ExitLoop Case $msg[0] = $GUI_EVENT_CLOSE And $msg[1] = $ChildGui GUISetState(@SW_ENABLE, $MainGui) GUISetState(@SW_HIDE, $ChildGui) Case $msg[0] = $LogButton GUISetState(@SW_DISABLE, $MainGui) GUISetState(@SW_SHOW, $ChildGui) EndSelect WEnd 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