473,382 Members | 1,665 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

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
4 10902
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Rich Tasker | last post by:
I have a strange situation. A simple call to MessageBox.Show("XXX", "YYY") does not display the message in the messagebox with a visible font. Based on the content of the messagebox, the box...
2
by: Dennis C. Drumm | last post by:
This is a restatement of an earlier post that evidently wasn't clear. I am building a custom MessageBox dialog that has, among other things, a few new button options (yes to all, no to all, etc.)...
8
by: Saso Zagoranski | last post by:
Hi! I'm trying to make my own MessageBox... What I would like to know is, how the MessageBox class is implemented? I could have something like: new MyMessageBox().ShowDialog(); but I would...
3
by: Sin | last post by:
I'm currently evaluating VC.NET as the new platform for the company I work for and things are looking grim... We're up against another IDE which took me about 5 minutes to master and I've been...
0
by: alex_f_il | last post by:
The class centers MessageBox inside the parent rectangle. Enjoy! using System; using System.Windows.Forms; using System.Text; using System.Drawing; using System.Runtime.InteropServices; ...
20
by: Peter E. Granger | last post by:
I'm having a strange problem (or at least it seems strange to me) trying to display a MessageBox in a VC++ .NET forms application. If I put the call to MessageBox::Show in the form's .h file, it...
10
by: Russ | last post by:
I've been trying to figure out how to show a simple messagebox with an OK button in my web client program (C#). I have looked at every reference to JScript and MessageBox that seemed even remotely...
2
by: Nuno Magalhaes | last post by:
Why does the MessageBox.Show function in the thread below changes the program behaviour, in other words, the APListView becomes filled with values with a call to RefreshAPListView. Without the...
6
by: Goran Djuranovic | last post by:
Hi all, I have a VB.NET windows application that uses MDI form. When I try to delete a datagrid row from one of the MDI children forms, I use a MessageBox YesNo confirmation, which, after confirmed,...
3
by: Andy | last post by:
Hi, I have a Wpf application, and have some code in my App.xaml.cs file that runs on Application_StartUp. It's possible for errors to occur here, and I let...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.