Sign in to follow this  
Followers 0
Dark_Raver

Quick Yes/No Dialog

11 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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]

Share this post


Link to post
Share on other sites

i saw that but i didnt knew how to use it

i do now :)

thanks for pointing it out :blink:

being rude sometimes helps :P

Share this post


Link to post
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]

Share this post


Link to post
Share on other sites

haha nah it was like "read the frigin manual moron" so i readed it and it made sense :P

didnt saw your code you entered tough but io got it now :blink:

any hints on the capitalization of the first letter tough?

it would work fine witouth it but would look nicer :)

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

any hints on the capitalization of the first letter tough?

I assume you would require this because your keyboard's shift key is busted...

Lar.


f_mrcleansmalm_77ce002.jpgAutoIt has helped make me wealthy

Share this post


Link to post
Share on other sites

no, it needed to read something out of a ini file and i want to make it so that you dont have to think about forgetting caps and such

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

search the included manual for the MsgBox function

there is a list :)

Star2 actualy mentioned it in the second post :P

Share this post


Link to post
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

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