Sign in to follow this  
Followers 0
soyfelix

what can i do two forms in one?

3 posts in this topic

#1 ·  Posted (edited)

hello, my english is very bad but i'll try.

I`d like learn to code two or more GUI in one. Now i`m coding in several indepent scripts but i'd like to code them in only one, is poissible??

thnaks!!!!!

Edited by soyfelix

Share this post


Link to post
Share on other sites



Here is base concept:

Core is to use GUIGetMsg(1)

; http://www.autoitscript.com/forum/index.php?showtopic=5127&hl

#include "GUIConstants.au3"

$parentgui = GUICreate("Parent",400,300)
GUISetState(@SW_SHOW)

$childgui = GUICreate("Child",340,120,-1,-1,BitOr($WS_POPUP,$WS_CAPTION,$WS_SYSMENU),-1,$parentgui)
GUISetState(@SW_SHOW)
GUISwitch($parentgui)
GUISetState(@SW_DISABLE)

While 1
    $msg = GUIGetMsg(1)

    $ctrlmsg = $msg[0]
    $win = $msg[1]
    $posx = $msg[3]
    $posy = $msg[4]
     Select
        Case $ctrlmsg = $GUI_EVENT_CLOSE And $win = $parentgui
            ExitLoop
       Case $ctrlmsg = $GUI_EVENT_CLOSE And $win = $childgui
           GUISwitch($parentgui)
            GUISetState(@SW_ENABLE)
           GUISwitch($childgui)
           GUISetState(@SW_HIDE)
    EndSelect
WEnd

GUIDelete()

Exit

Share this post


Link to post
Share on other sites

Here is base concept:

Core is to use GUIGetMsg(1)

; http://www.autoitscript.com/forum/index.php?showtopic=5127&hl

#include "GUIConstants.au3"

$parentgui = GUICreate("Parent",400,300)
GUISetState(@SW_SHOW)

$childgui = GUICreate("Child",340,120,-1,-1,BitOr($WS_POPUP,$WS_CAPTION,$WS_SYSMENU),-1,$parentgui)
GUISetState(@SW_SHOW)
GUISwitch($parentgui)
GUISetState(@SW_DISABLE)

While 1
    $msg = GUIGetMsg(1)

    $ctrlmsg = $msg[0]
    $win = $msg[1]
    $posx = $msg[3]
    $posy = $msg[4]
     Select
        Case $ctrlmsg = $GUI_EVENT_CLOSE And $win = $parentgui
            ExitLoop
       Case $ctrlmsg = $GUI_EVENT_CLOSE And $win = $childgui
           GUISwitch($parentgui)
            GUISetState(@SW_ENABLE)
           GUISwitch($childgui)
           GUISetState(@SW_HIDE)
    EndSelect
WEnd

GUIDelete()

Exit

Exactly!!!!!!! I was looking for somethig like this, i`m going to study your code. THANKSSSSSSSSSSSSSSSSSSSSSSSSSSSSS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Share this post


Link to post
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
Sign in to follow this  
Followers 0