cad29 Posted September 3, 2006 Share Posted September 3, 2006 Hi i need help with my little program what i what i do is i have a msgbox when he click yes it should display you click yes and if they click no it should display you click no Program that i have is #include <GUIConstants.au3> msgbox(4,"Please click yes or no","Please click yes or no") but the problem is i dont know how to continue thanks for the help in adavanced Link to comment Share on other sites More sharing options...
BigDod Posted September 3, 2006 Share Posted September 3, 2006 $msg = msgbox(4,"Please click yes or no","Please click yes or no") If $msg = 6 Then MsgBox(0,"", "You answered yes") Else MsgBox(0,"", "You answered no") EndIf Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
cad29 Posted September 3, 2006 Author Share Posted September 3, 2006 Thanks Bigdod it work your the man Link to comment Share on other sites More sharing options...
BigDod Posted September 3, 2006 Share Posted September 3, 2006 (edited) Another version $msg = msgbox(4,"Please click yes or no","Please click yes or no") If $msg = 6 Then MsgBox(0,"", "You answered yes") ElseIf $msg = 7 Then MsgBox(0,"", "You answered no") EndIf Incase there are more than 2 buttons. Edited September 3, 2006 by BigDod Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted September 3, 2006 Moderators Share Posted September 3, 2006 Or even:Switch MsgBox(4,"Please click yes or no","Please click yes or no") Case 6 MsgBox(0,"", "You answered yes") Case 7 MsgBox(0,"", "You answered no") EndSwitch Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
cad29 Posted September 4, 2006 Author Share Posted September 4, 2006 Is there anyway to change the location of the message box?because it is being default into the center can i change it to be on the top most?thanks a lot Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted September 4, 2006 Moderators Share Posted September 4, 2006 Is there anyway to change the location of the message box?because it is being default into the center can i change it to be on the top most?thanks a lotInstructions in the helpfile show you how to make it topmost.The moving issue ... there are a couple of work around UDF's in the Scripts and Scraps forum. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Paulie Posted September 4, 2006 Share Posted September 4, 2006 (edited) Instructions in the helpfile show you how to make it topmost. The moving issue ... there are a couple of work around UDF's in the Scripts and Scraps forum.I asked this question as one of my like 2nd questions HereWasPlato Concocted this script which worked for me ;requires beta ;sure seems like a GUI would be easier For $Int = 1 to 10 _MoveMsgBox(0, $Int, $Int , 0 + Random(0,@DesktopWidth)-100, Random(1,@DesktopHeight)-100) Next Func _MoveMsgBox($MBFlag, $MBTitle, $MBText, $x , $y) Local $file = FileOpen(EnvGet("temp") & "\MoveMB.au3", 2) If $file = -1 Then Return;if error, give up on the move Local $line0 = '#NoTrayIcon' Local $line1 = 'AutoItSetOption(' & '"WinWaitDelay", 0' & ')' Local $line2 = 'WinWait("' & $MBTitle & '", "' & $MBText & '")' Local $line3 = 'WinMove("' & $MBTitle & '", "' & $MBText & '"' & ', ' & $x & ', ' & $y & ')' FileWrite($file,$line0 & @CRLF & $line1 & @CRLF & $line2 & @CRLF & $line3) FileClose($file) Run(@AutoItExe & " /AutoIt3ExecuteScript " & EnvGet("temp") & "\MoveMB.au3") MsgBox($MBFlag, $MBTitle, $MBText) FileDelete(EnvGet("temp") & "\MoveMB.au3") EndFunc;==>_MoveMsgBox Edited September 4, 2006 by Paulie Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted September 4, 2006 Moderators Share Posted September 4, 2006 I asked this question as one of my like 2nd questionsHereWasPlato Concocted this script which worked for meWe expanded that a tad:http://www.autoitscript.com/forum/index.ph...st&p=187268 Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Paulie Posted September 4, 2006 Share Posted September 4, 2006 We expanded that a tad:http://www.autoitscript.com/forum/index.ph...st&p=187268lol"A tad" you say Wish I could use that, but i'm out a StringRegExp Function is it in an Include? cause i can't find it Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted September 4, 2006 Moderators Share Posted September 4, 2006 lol"A tad" you say Wish I could use that, but i'm out a StringRegExp Function is it in an Include? cause i can't find it They took the documentation out when they released 3.1.133... they haven't put it back yet, however, it's still a working function. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Paulie Posted September 4, 2006 Share Posted September 4, 2006 They took the documentation out when they released 3.1.133... they haven't put it back yet, however, it's still a working function.but is says Undefined function for me, and I'm using the latest release Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted September 4, 2006 Moderators Share Posted September 4, 2006 but is says Undefined function for me, and I'm using the latest release That's only when you do an Au3Check in SciTe because it isn't in their pre-defined functions, just run it... you'll be fine. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now