#RequireAdmin #include #include #include #include ;~ #include ;~ Global $Label2 Global $Button2 = 9999 ; Need to set a placeholder value or it fires immediately Global $Button3 = 9999 Global $Label2 = 0, $Label3 = 0, $Label4 = 0 $Form1 = GUICreate("Form1", 530, 453, 713, 371) $Label1 = GUICtrlCreateLabel(@CRLF & @CRLF & "Application 1", 48, 24, 191, 144, $SS_CENTER) GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif") GUICtrlSetBkColor(-1, 0xFFFF00) GUI2() ; From Application 2 $FixedLable = GUICtrlCreateLabel(@CRLF & @CRLF & @CRLF & "Fixed label", 40, 224, 436, 196, $SS_CENTER) GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif") GUICtrlSetBkColor(-1, 0x008000) GUICtrlSetState(-1, $GUI_DISABLE) ; Need to disable label if you want the overlapping button to work GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Label2 GUICtrlSetState($FixedLable, $GUI_HIDE) ; Hide $FixedLable APP2() Case $Button2 ; place Button 2 Case here GUICtrlSetState($Label4, $GUI_HIDE) GUICtrlSetState($Button2, $GUI_HIDE) GUICtrlSetState($Button3, $GUI_HIDE) MsgBox(0, '', 'Taking back to Home screen') GUICtrlSetState($FixedLable, $GUI_SHOW) Case $Button3 GUICtrlSetState($Button2, $GUI_HIDE) MsgBox(0, '', 'Running further Actions...', 3) MsgBox(0, '', 'Actions completed.', 3) GUICtrlSetState($Label4, $GUI_HIDE) GUICtrlSetState($Button3, $GUI_HIDE) GUICtrlSetState($FixedLable, $GUI_SHOW) EndSwitch WEnd Func GUI2() ;~ ConsoleWrite("Running GUI2" & @CRLF) $Label2 = GUICtrlCreateLabel(@CRLF & @CRLF & "Application 2", 264, 24, 191, 144, $SS_CENTER) GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlSetBkColor(-1, 0x0000FF) EndFunc Func APP2() $Button2 = GUICtrlCreateButton("Close Label 3 and this Button", 264, 360, 203, 41) ; This button should come up when $Lable2 is clicked. ;So, where to place this button so it is clicked it should hide the $Lable2, $Lable3 and Button2 $Button3 = GUICtrlCreateButton("Button 3", 100, 360, 100, 41) ; This button should come up when $Lable2 is clicked. ;~ $Label3 = GUICtrlCreateLabel("", 40, 224, 436, 196, $SS_CENTER) ;~ GUICtrlSetState(-1, $GUI_DISABLE) ; Need to disable label if you want the overlapping button to work $Label4 = GUICtrlCreateLabel(@CRLF & @CRLF & @CRLF & "This will be the Child GUI / cutom include launched when Application 2 is clicked.", 40, 224, 436, 196, $SS_CENTER) GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif") GUICtrlSetBkColor(-1, 0x008000) ;~ $Button2 = GUICtrlCreateButton("Close Label 3 and this Button", 264, 360, 203, 41) ; This button should come up when $Lable2 is clicked. ;So, where to place this button so it is clicked it should hide the $Lable2, $Lable3 and Button2 ;~ $Button3 = GUICtrlCreateButton("Button 3", 100, 360, 100, 41) ; This button should come up when $Lable2 is clicked. EndFunc