MessageBox.Show behaving as non-modal

  • Thread starter Thread starter Drew Lettington
  • Start date Start date
D

Drew Lettington

I'm making a simple call to display error messages in a
MessageBox from a Windows form and the MessageBox is not
behaving in a modal fashion. My modal form displays, the
user clicks a button and error handling code calls
MessageBox.Show. The user is then allowed to click the
button on my form again before clicking OK on the
MessageBox.

Any ideas why the MessageBox is not behaving modally?

I'm using Visual C# 2003. Here's the MessageBox call:

public static void DisplayMyError(string myError,
MessageBoxButtons buttons, MessageBoxIcon icon)
{
MessageBox.Show(myError, "My
Title",
buttons, icon);
}
 
The is no explicit multi-threading. I have a dll,
loaded into Office via COM extensibility. That dll opens
a modal Windows form and the modal form displays an error
message in a standard MessageBox.
 
Back
Top