If 6 = MsgBox doesn't stop code advance

I can’t reproduce it with a simple app and the code in a Button action event.

I even changed my Keyboard setting so I can see the “glow” around the No button on the MsgBox.

I hope a reboot, clear cache or something like that can help you.

I don’t think is a memory display problem, because your code continues even if you didn’t click Yes.

Is your ‘if - end if’ code inside a special area of the program? Sorry I’m new to many things, something like a thread that the use of MsgBox is not recommended.

Have you considered abandoning the MsgBox for the more modern and correct MessageDialog? You have far more control over the displayed dialog and your code is much more clear - a bit more verbose, but far more clear.

Well I like verbose :slight_smile:

I’m no expert, but I can’t help feel there is a logic issue with:

If 6 = MsgBox( "Do You Want to Update the Dictionary" + EOL + ...... etc...")

It’s as though the question is already resolved before the message box appears.

Nevertheless, I like this, along the lines of what brian franco posted above (but even MORE verbose)

Dim result As Integer result = MsgBox ("Do you want to rebuild this mailbox?", 36) If result = 6 Then // user pressed Yes // Then do what you need to do... ElseIf result = 7 Then // user pressed No // Otherwise, just continue with whatever happens next End If

Try using 4 as the buttons parameter instead of 36. I know that I’ve written code like this that works…

if msgbox ("Are you sure?", 4) = 6 then // user clicked Yes End If

if msgbox ("Are you sure?", 4) = 6 then // user clicked Yes End If

:wink:

[missing quote, and you should use straight quotes as curly quotes can be mischievous]

I finally resolved my problem by making it set a boolean and moving it out of Both if blocks.
I did try the MessageDialog and the app even switched the boolean. The MessageDialog is MyMsgBox

[code]Dim dontRun As Boolean = False

If DictBildThrd.State = thread.Running Then
Return
End If

If YPrf.FOpnRun = True And (DFilListA.Ubound > -1 Or YDSet) Then
If 6 = App.MyMsgBox( “Do You Want to Update the Dictionary” + EOL + _
“This Should be Denied IF Practice Files NEED to be Processed”, False) Then
YPrf.FOpnRun = True
dontRun = True
End If
End If
If dontRun = True Then
DictBildThrd.Run
End If[/code]

About the curly quotes, I have that turned off in my Mac because of that sort of problem.

But that won‘t help with copy&paste …

[quote=411311:@Markus Winter]if msgbox ("Are you sure?", 4) = 6 then // user clicked Yes End If

:wink:

[missing quote, and you should use straight quotes as curly quotes can be mischievous][/quote]
That’s what I get for typing code on my phone at 5:30am.