Jump to content
Sign in to follow this  

Parent and Child help

Recommended Posts

Could someone explain because I couldn't find anything useful in the help file!

I created a GUI and when you press a button a calendar appears but when I close the calendar the whole program closes!


Can you post the script?

It could be that you need to use

$msg = GuiGetMsg(1);advanced mode so you can tell which window gave the message
switch $msg[0]
        if $msg[1] = $guiChild then GuiDelete($guichild)
        if $msg[1] = $guiparent then exit

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post

Link to post
Share on other sites

How should I change it martin?

While 1
    $gm = GUIGetMsg()
    Switch $gm
        Case $GUI_EVENT_CLOSE
        Case $cal
            MsgBox(0, 'Calendar', GUICtrlRead($cal))
Edited by 3dude

View my blog :) 3dude's blog <= help with project :S

Share this post

Link to post
Share on other sites

#include <guiconstants.au3>

$the_GUI = GUICreate ("Test" , 200 , 80,-1,-1,$WS_CAPTION)
$button = GUICtrlCreateButton ("Show Calander" , 20 , 10 , 100, 25)
$exit = GUICtrlCreateButton ("Exit" , 20 , 45 , 100, 25)
GUISetState (@SW_SHOW, $the_GUI)

$date = GUICreate ( "My GUI get date", 200,80,-1,-1,$WS_CAPTION)
$back = GUICtrlCreateButton ("Back" , 20 , 45 , 100, 25)
GUICtrlCreateDate ("1953/04/25", 10,10,185,20 )
GUISetState (@SW_HIDE, $date)
While 1
    $msg = GUIGetMsg ()
    ; ==== buttons events  ======
        Case $msg = $exit
        Case $msg = $button
            GUISetState (@SW_HIDE, $the_GUI)
            GUISetState (@SW_SHOW, $date)
        Case $msg = $back
            GUISetState (@SW_SHOW, $the_GUI)
            GUISetState (@SW_HIDE, $date)

is this what u need?

Edited by star2

[quote]Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams[/quote].............................................................................[u]AUTOIT[/u]

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  

  • Create New...