Hyflex Posted June 30, 2017 Share Posted June 30, 2017 I've tried to get the MsgBox's working for quite a while and searched the forums, stackoverflow and google but can't find how to resolve this. I've tried to create a messagebox in Scite but that too has the same issue where none of the results work except for the else... which is pretty useless. See some example code below: #include <MsgBoxConstants.au3> ;#include <GuiConstantsEx.au3> $Status = "Test" $Message = "Beep Beep" If Not IsDeclared("UpdateResult") Then Local $UpdateResult $UpdateResult = MsgBox($MB_OKCANCEL & $MB_ICONWARNING, $Status & " Available", "There is a " & $Status & "." & @CRLF & @CRLF & "Press OK to " & $Status & @CRLF & @CRLF & $Message) Select Case $UpdateResult = 1 ;OK ConsoleWrite("Switch 1" & @CRLF) Case $UpdateResult = 2 ConsoleWrite("Switch 2" & @CRLF) EndSelect If $UpdateResult = 1 Then ConsoleWrite("If 1" & @CRLF) ElseIf $UpdateResult = 2 Then ConsoleWrite("ElseIf" & @CRLF) Else ConsoleWrite("Else" & @CRLF) ; Only one that fires.... EndIf How do I get OK button & cancel button to do things...? Thanks Link to comment Share on other sites More sharing options...
InnI Posted June 30, 2017 Share Posted June 30, 2017 (edited) Not &, but + $UpdateResult = MsgBox($MB_OKCANCEL + $MB_ICONWARNING, ... Edited June 30, 2017 by InnI Link to comment Share on other sites More sharing options...
moimon Posted July 2, 2017 Share Posted July 2, 2017 For example, to specify a SYSTEMMODAL box with the YES/NO buttons the flag value would be 4096+4 (or 4100) If using hexadecimal flags, that would be 0x1000+0x4 (or 0x1004). Link to comment Share on other sites More sharing options...
Skysnake Posted August 10, 2017 Share Posted August 10, 2017 Like this? #include <MsgBoxConstants.au3> ;#include <GuiConstantsEx.au3> $Status = "Test" $Message = "Beep Beep" If Not IsDeclared("UpdateResult") Then Local $UpdateResult $UpdateResult = MsgBox($MB_OKCANCEL + $MB_ICONWARNING, $Status & " Available", "There is a " & $Status & "." & @CRLF & @CRLF & "Press OK to " & $Status & @CRLF & @CRLF & $Message) Select Case $UpdateResult = 1 ;OK ConsoleWrite("Switch 1" & @CRLF) ConsoleWrite("Select --- the first time I had to do something " & $UpdateResult & @CRLF ) Case $UpdateResult = 2 ConsoleWrite("Switch 2" & @CRLF) EndSelect If $UpdateResult = 1 Then ConsoleWrite("If 1" & @CRLF) ConsoleWrite("Select --- the second time I had to do something " & $UpdateResult & @CRLF ) ElseIf $UpdateResult = 2 Then ConsoleWrite("ElseIf" & @CRLF) Else ConsoleWrite("Else" & @CRLF) ; Only one that fires.... EndIf Like @InnI wrote, your MsgBox flags were wrongly formatted... Skysnake Skysnake Why is the snake in the sky? 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