Sign in to follow this  
Followers 0
arminius

how to have different effects per button on msg box

6 posts in this topic

I'm wanting msg box to turn itself off when i click on the default ok button, this happens with the following coding

CODE
Select

; Daily Rituals

Case @HOUR=06

MsgBox(262144, "Reminder", "go to class")

Case @HOUR=17

MsgBox(262144, "Reminder", "cook dinner")

EndSelect

but I want their to be a second button which when I click on it will make the button appear again say 30 mins

all I'm having trouble with is setting the differnt execute with the spare button? how would I do that?

Share this post


Link to post
Share on other sites



Here's a starter:

$result = Msgbox(4, 'Question', 'Is AutoIt awesome?')
If $result = 6 then 
Msgbox(0, 'Correct', 'Good answer')
Else 
Msgbox(0, 'Wrong', 'You are crazy!')
Endif

You can have different buttons, look in the helpfile for those options. Each button has it's own return value (like Yes is 6), you can find those in the helpfile too.


My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]

Share this post


Link to post
Share on other sites

how would I go about keeping the case system I have, but still having the result = 1 then do this, result = 1 then do something completely different

Share this post


Link to post
Share on other sites

how would I go about keeping the case system I have, but still having the result = 1 then do this, result = 1 then do something completely different

Code would help.... My Crystal ball is cloudy...

Share this post


Link to post
Share on other sites

I ment to say

how would I go about keeping the case system I have, but still having the result = 1 then do this, result = 2 then do something completely different

Share this post


Link to post
Share on other sites

I ment to say

how would I go about keeping the case system I have, but still having the result = 1 then do this, result = 2 then do something completely different

Hard to say without code, but maybe...

$msg = ""
$szName = InputBox(Default, "Please enter a word.", "", " M", Default, Default, Default, Default, 10)
Switch @error
Case 2
    $msg = "Timeout "
    ContinueCase
Case 1; Continuing previous case
    $msg &= "Cancellation"
Case 0
    Switch $szName
    Case "a", "e", "i", "o", "u"
        $msg = "Vowel"
    Case "QP"
        $msg = "Mathematics"
    Case "Q" to "QZ"
        $msg = "Science"
    Case Else
        $msg = "Others"
    EndSwitch
Case Else
    $msg = "Something went horribly wrong."
EndSwitch

MsgBox(0, Default, $msg)

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