Jump to content

Why the button is unclickable?


Recommended Posts

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'); }

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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'); }

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...