Jump to content
Sign in to follow this  
Thompson

Msgbox

Recommended Posts

Thompson

Hi

I want to make a yes/no msgbox

like this:

MsgBox(4100, "Test", "TEST")

if i push yes he continues

and if i push no also

How do i make when i push yes he will run

And if i push no he will Exit

Thx

Share this post


Link to post
Share on other sites
Somerset

$begin=MsgBox(0x4, "Test", "Ready to begin?")
if $begin = 7 then exit

MsgBox(4096, "Test", "You pressed yes to get to this next message box", 10)


 

Spoiler

shoot_zpsfd329d66.png
dontbelieveeverythingyouthink_zps0e1e900

Madness is the first step to understanding...

Share this post


Link to post
Share on other sites
BALA

I just wanted to add, if you want to specifically tell if a person clicked yes or no, you would do something like this:

$confirm = MsgBox(4, "Confirmation", "Yes or No?")
    If $confirm = 6 Then ; Checks for 'Yes'
        MsgBox(0, "Yes", "You clicked 'Yes'")
    EndIf
    If $confirm = 7 Then ; Checks for 'No'
        MsgBox(0, "No", "You clicked 'No'")
    EndIfoÝ÷ Ù8^Ú,z۩­ʷö·¬k(§«­¢+ØÀÌØí½¹¥É´ô5Í   ½à аÅÕ½Ðí
½¹¥ÉµÑ¥½¸ÅÕ½Ðì°ÅÕ½Ðíe̽È9¼üÅÕ½Ðì¤(%%ÀÌØí½¹¥É´ôØQ¡¸ì
¡­Ì½ÈÌäíeÌÌäì($$ìAÕÐÝ¡Ðå½ÔݹÐѼ¡ÁÁ¸¥Ñ¡ä±¥¬eÌ(%¹%(%ÀÌØí½¹¥É´ôÜQ¡¸ì
¡­Ì½ÈÌäí9¼Ìäì($%á¥Ðì
±½ÍÌÍÉ¥ÁÐ(%¹%
Edited by BALA

[font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com

Share this post


Link to post
Share on other sites
BALA

Probably better as...

$confirm = MsgBox(4, "Confirmation", "Yes or No?")
If $confirm = 6 Then ; Checks for 'Yes'
     ; Put what you want to happen if they click Yes
Else
     Exit ; Closes script
EndIf
But wouldn't that also go off if there's an error then?

Failure: Returns -1
Edited by BALA

[font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com

Share this post


Link to post
Share on other sites
BALA

Not sure how you'd produce an error out of a Yes/No message box when you're not using a timeout.

Oh sorry didn't notice the timeout

In that case, using an Else is easier than having to type out the whole If statement again.

Edited by BALA

[font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com

Share this post


Link to post
Share on other sites
Tentaal

Maybe a stupid question but...

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $Radio1
            $Choice = MsgBox(4, "CTPPatchsCollection " & $version, "You are going to update Call to Power I.")
                if $Choice=6 then; Yes
                    run(@TempDir & "\cctp1_2_f.exe")
                    GUICtrlSetState($Radio1,$GUI_UNCHECKED) 
                EndIf
                if $choice=7 then; No
                    GUICtrlSetState($Radio1,$GUI_UNCHECKED) 
                EndIF
...

When I select $Radio1 I get the YES/NO Box. All is fine. If I check NO, I go back to the main GUI. If I check Yes, and then I cancel the installation process, I go back to the YES/NO box and I cannot go back to the main GUI. Why???

Thanks!

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.