Hello All,

Posting on this forum after a long time. Thanks for all the support I received on these forums earlier.

I am currently working on a product which is a WPF application and the language used is VB.NET. There are a lot of message boxes that pop up when invoked conditionally and there is no error. However, since past two days, when I am trying to make a simple call to a Message Box, it fails with the below error message:

dispatcher processing has been suspended, but messages are still being processed.
'[1] The below call to a VB6 style Message Box succeeds when invoked in a method but fails when invoked within an event handler
MsgBox(ErrMsg, CType(MsgBoxStyle.Exclamation + MsgBoxStyle.OkOnly, MsgBoxStyle),"Custom Error")
'[2] The below call to WPF MessageBox API succeeds when invoked in a method but fails when invoked within an event handler as well
MessageBox.Show(ErrMsg, "Custom Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
'[3] The above calls succeed when invoked from a Dispatcher
	MessageBox.Show(strErrMsg, "Custom Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Sub)
I do not even want to use dispatcher, as I am not creating any other thread. I want to execute the call synchronously and wait for the Message Box to popup and proceed to next line of code only after user clicks on OK button of the message box. Although I see many threads in the thread window and when observed in debug mode, the execution is never passed on to the other threads as far as the code around the above call is concerned.

What could be the possible cause for this behavior and how should I make the call to prevent the above error?