467,877 Members | 892 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,877 developers. It's quick & easy.

MessageBox.Show behaving as non-modal

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
  • viewed: 10448
Share:
4 Replies
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

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
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
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.

Similar topics

11 posts views Thread by Rich Tasker | last post: by
2 posts views Thread by Dennis C. Drumm | last post: by
8 posts views Thread by Saso Zagoranski | last post: by
reply views Thread by alex_f_il | last post: by
20 posts views Thread by Peter E. Granger | last post: by
10 posts views Thread by Russ | last post: by
2 posts views Thread by Nuno Magalhaes | last post: by
6 posts views Thread by Goran Djuranovic | last post: by
3 posts views Thread by Andy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.