Jump to content

Quick Yes/No Dialog


Recommended Posts

is there a way to make a quick yes/no dialog boxwitouth creating a new gui?

i know that i can use

MsgBox(4,"","")

but i dont know how to detect the yes/no clicks in it

either a solution or a tip to how to accept input would be very gratefull :)

EDIT: oh and anyone has a snippet of code to dorce the first letter of a word to be capitalized?

Edited by Dark_Raver
Link to comment
Share on other sites

right from the help file

Return Value

Success: Returns the ID of the button pressed.

Failure: Returns -1 if the message box timed out.

Button Pressed Return Value

OK 1

CANCEL 2

ABORT 3

RETRY 4

IGNORE 5

YES 6

NO 7

TRY AGAIN ** 10

CONTINUE ** 11

$t = MsgBox (4, "test" ,"test")
If $t = 6 Then
    SplashTextOn ("", "you have pressed Yes", 250, 30,-1,-1,1,-1,14,600)
    Sleep (2000)
ElseIf $t = 7 Then
    SplashTextOn ("", "you have pressed No", 250, 30,-1,-1,1,-1,14,600)
    Sleep (2000)
EndIf
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]

Link to comment
Share on other sites

thanks for pointing it out :P

being rude sometimes helps :)

anything I said was rude to you?

[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]

Link to comment
Share on other sites

EDIT: oh and anyone has a snippet of code to dorce the first letter of a word to be capitalized?

This will change the first letter to upper case for a single word or a string of space separated words.

$Test = "lowercase words in a title"
$Test2 = _StringTitleCase($Test)

MsgBox(0, "Title Case", "Before:" & @CRLF & $Test & @CRLF & "After:" & @CRLF & $Test2 )

Func _StringTitleCase($Title_In)
Local $asWords = 0
Local $sTitle = ''
    $asWords = StringSplit($Title_In," ")
    If IsArray($asWords) Then
        For $i = 1 To $asWords[0]
            $asWords[$i] = StringUpper(StringLeft($asWords[$i],1)) & StringMid($asWords[$i],2)
        Next
        
        For $i = 1 To $asWords[0] - 1
            $sTitle &= $asWords[$i] & " "
        Next
        $sTitle &= $asWords[$asWords[0]]
        Return $sTitle
    Else
        Return $Title_In
    EndIf
EndFunc

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

Link to comment
Share on other sites

can i just ask on question

how do u know wat number yes or no is?

cheers C.W

C.Wnew rules:1.dont use plz in a post or title use please instead2.always use help file as it is now muchly over rated3. dont think where not watching u4.please wait 24 hours after last post ot bump XD i use to make that mistake

Link to comment
Share on other sites

ok

sorry because i see people knowing these numbers all over the place and are they the same as the html/javascript ones?

C.Wnew rules:1.dont use plz in a post or title use please instead2.always use help file as it is now muchly over rated3. dont think where not watching u4.please wait 24 hours after last post ot bump XD i use to make that mistake

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