Jump to content
Sign in to follow this  
nht3004

Why the button is unclickable?

Recommended Posts

nht3004

I have a form, and then when I delete it ( because I can't exit program ), the buttons of the other form of my program became unclickable, they won't response the mouse!

Example:

$confirmForm=GUICreate("Confirm", 314, 136);
$yes=GUICtrlCreateButton("Yes", 8, 104, 55, 25);
GUISetState(@SW_SHOW);
While 1
    $msgConfirmForm=GUIGetMsg();
    Switch $msgConfirmForm;
        Case $GUI_EVENT_CLOSE;
            Exit
        Case $yes;
            $deleteForm=GUICreate("Trial Form", 314, 136);
            $delete=GUICtrlCreateButton("Delete Form", 8, 104, 55, 25);
            GUISetState(@SW_SHOW);
            While 1
                $msgDeleteForm=GUIGetMsg();
                Switch $msgDeleteForm;
                    Case $GUI_EVENT_CLOSE;
                        Exit;
                    Case $delete;
                        GUIDelete($deleteForm);
                EndSwitch
            WEnd
    EndSwitch
WEnd

When I click delete button, the $deleteForm is deleted but the button on the confirmForm is no longer clickable!

Help me to fix that, or is it a bug?


for(loop=0; loop<infinity; loop++) { alert('I love you'); }

Share this post


Link to post
Share on other sites
mexykanu

i think this is it. you forgot to add a ExitLoop after GUIDelete($deleteForm);

#include <GUIConstantsEx.au3>

$confirmForm=GUICreate("Confirm", 314, 136);
$yes=GUICtrlCreateButton("Yes", 8, 104, 55, 25);
GUISetState(@SW_SHOW);
While 1
    $msgConfirmForm=GUIGetMsg();
    Switch $msgConfirmForm;
        Case $GUI_EVENT_CLOSE;
            Exit
        Case $yes;
            $deleteForm=GUICreate("Trial Form", 314, 136);
            $delete=GUICtrlCreateButton("Delete Form", 8, 104, 55, 25);
            GUISetState(@SW_SHOW);
            While 1
                $msgDeleteForm=GUIGetMsg();
                Switch $msgDeleteForm;
                    Case $GUI_EVENT_CLOSE;
                        Exit;
                    Case $delete;
                        GUIDelete($deleteForm);
                        ExitLoop
                EndSwitch
            WEnd
    EndSwitch
WEnd
Edited by mexykanu

Share this post


Link to post
Share on other sites
nht3004

i think this is it. you forgot to add a ExitLoop after GUIDelete($deleteForm);

#include <GUIConstantsEx.au3>

$confirmForm=GUICreate("Confirm", 314, 136);
$yes=GUICtrlCreateButton("Yes", 8, 104, 55, 25);
GUISetState(@SW_SHOW);
While 1
    $msgConfirmForm=GUIGetMsg();
    Switch $msgConfirmForm;
        Case $GUI_EVENT_CLOSE;
            Exit
        Case $yes;
            $deleteForm=GUICreate("Trial Form", 314, 136);
            $delete=GUICtrlCreateButton("Delete Form", 8, 104, 55, 25);
            GUISetState(@SW_SHOW);
            While 1
                $msgDeleteForm=GUIGetMsg();
                Switch $msgDeleteForm;
                    Case $GUI_EVENT_CLOSE;
                        Exit;
                    Case $delete;
                        GUIDelete($deleteForm);
                        ExitLoop
                EndSwitch
            WEnd
    EndSwitch
WEnd
Thanks alot, it works ^^!

for(loop=0; loop<infinity; loop++) { alert('I love you'); }

Share this post


Link to post
Share on other sites
mexykanu

You're welcome ^_^

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  

×