#RequireAdmin #include #include #include #include ;~ #include Global $Label2, $Label4 Global $Button2 = 9999 ; Need to set a placeholder value or it fires immediately Global $Button3 = 9999 Global $Label2 = 0 ;~ $Label3 = 0 Global $Label4 = 0 #Region ; Application 1 Func Application1() $Label1 = GUICtrlCreateLabel(@CRLF & @CRLF & "Application 1", 48, 24, 191, 144, $SS_CENTER) GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif") GUICtrlSetBkColor(-1, 0xFFFF00) EndFunc #EndRegion #Region ; Application2 Func Application2() ;~ ConsoleWrite("Running Application2" & @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() ;~ $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. $Button3 = GUICtrlCreateButton("Button 3", 100, 360, 100, 41) ; This button should come up when $Lable2 is clicked. EndFunc #EndRegion #Region ; Parent GUI $Form1 = GUICreate("Form1", 530, 453, 713, 371) $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 Application1() Application2() ; From Application 2 GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Label2 ; Pressing Lable2 should launch APP2() everytime making all Lables and buttons Active within the func... ;~ GUICtrlSetState($FixedLable, $GUI_HIDE) ; Hide $FixedLable APP2() Case $Button2 ; Pressing Button 2 should Hide the APP2() GUICtrlSetState($Label4, $GUI_HIDE) GUICtrlSetState($Button2, $GUI_HIDE) GUICtrlSetState($Button3, $GUI_HIDE) Case $Button3 ; Pressing Button 3 should Hide only the Lable 4 and Button 2 within APP2() GUICtrlSetState($Button2, $GUI_HIDE) GUICtrlSetState($Label4, $GUI_SHOW) EndSwitch WEnd #EndRegion