By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,281 Members | 2,216 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,281 IT Pros & Developers. It's quick & easy.

MessageBox.Show behaving as non-modal

P: n/a
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);
}
Jul 21 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
you have more than 1 thread running?

"Drew Lettington" <an*******@discussions.microsoft.com> wrote in message
news:04****************************@phx.gbl...
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);
}

Jul 21 '05 #2

P: n/a

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.
-----Original Message-----
you have more than 1 thread running?

"Drew Lettington" <an*******@discussions.microsoft.com> wrote in messagenews:04****************************@phx.gbl...
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);
}

.

Jul 21 '05 #3

P: n/a
js
I had the same problem. I'm sure I'm using single thread.

Anybody has the answer?

-jason
"Drew Lettington" <an*******@discussions.microsoft.com> wrote in message
news:01****************************@phx.gbl...

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.
-----Original Message-----
you have more than 1 thread running?

"Drew Lettington" <an*******@discussions.microsoft.com>

wrote in message
news:04****************************@phx.gbl...
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);
}

.

Jul 21 '05 #4

P: n/a
Did you ever figure this out? What if you pass in the owner parameter?
Does that fix it?

m

"js" <ja***@nospam.com> wrote in message news:<u9**************@TK2MSFTNGP11.phx.gbl>...
I had the same problem. I'm sure I'm using single thread.

Anybody has the answer?

-jason
"Drew Lettington" <an*******@discussions.microsoft.com> wrote in message
news:01****************************@phx.gbl...

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.
-----Original Message-----
you have more than 1 thread running?

"Drew Lettington" <an*******@discussions.microsoft.com> wrote in messagenews:04****************************@phx.gbl...
> 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);
> }
.

Jul 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.