Jump to content

changing focus on subGUI


FMS
 Share

Recommended Posts

Dear reader,

I've a little problem that could solved easily i ques....

But i'm making a script whit a child GUI and when i close this child the whole script ends :S

and what i want to do is just closing the child GUI :S ...

could someone help me whit this?

simplefied i got this :

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

$Form1 = GUICreate("Form1", 633, 454, 192, 114)
$Button1 = GUICtrlCreateButton("Button1", 96, 64, 361, 65, $WS_GROUP)
GUISetState(@SW_SHOW)
$GUI = GUICreate("Form2", 133, 154, 192, 114)


Global $Show = False

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            $Show = Not $Show
            GUISetState($Show, $GUI)
    EndSwitch
WEnd

thnx in advanced :huh2:

as finishing touch god created the dutch

Link to comment
Share on other sites

Try with this

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

$Form1 = GUICreate("Form1", 633, 454, 192, 114)
$Button1 = GUICtrlCreateButton("Button1", 96, 64, 361, 65, $WS_GROUP)
GUISetState(@SW_SHOW)
$GUI = GUICreate("Form2", 133, 154, 192, 114)


Global $Show = True

While 1
    $nMsg = GUIGetMsg(1)
    Switch $nMsg[1]
        Case $Form1
            Switch $nMsg[0]
                Case $GUI_EVENT_CLOSE
                    Exit
                Case $Button1
;~                  $Show = Not $Show
                    GUISetState(@SW_SHOW, $GUI)
            EndSwitch
        Case $GUI
            Switch $nMsg[0]
                Case $GUI_EVENT_CLOSE
                    GUISetState(@SW_HIDE, $GUI)
            EndSwitch
    EndSwitch

WEnd
Look also here. I don't know how this works
GUISetState($Show, $GUI)

Link to comment
Share on other sites

Try this:

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

$Form1 = GUICreate("Form1", 633, 454, 192, 114)
$Button1 = GUICtrlCreateButton("Button1", 96, 64, 361, 65, $WS_GROUP)
GUISetState(@SW_SHOW, $Form1)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            $GUI = GUICreate("Form2", 133, 154, 192, 114, Default, Default, $Form1)
            GUISetState(@SW_SHOW, $GUI)
            GUISetState(@SW_DISABLE, $Form1)
            Do
                $nMsg = GUIGetMsg()
            Until $nMsg = $GUI_EVENT_CLOSE
            GUISetState(@SW_ENABLE, $Form1)
            GUIDelete($GUI)
    EndSwitch
WEnd

Br,

UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...