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,
MessageBoxButto ns buttons, MessageBoxIcon icon)
{
MessageBox.Show (myError, "My
Title",
buttons, icon);
} 4 10946
you have more than 1 thread running?
"Drew Lettington" <an*******@disc ussions.microso ft.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, MessageBoxButto ns 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. -----Original Message----- you have more than 1 thread running?
"Drew Lettington" <an*******@disc ussions.microso ft.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, MessageBoxButto ns buttons, MessageBoxIcon icon) { MessageBox.Show (myError, "My Title", buttons, icon); }
.
I had the same problem. I'm sure I'm using single thread.
Anybody has the answer?
-jason
"Drew Lettington" <an*******@disc ussions.microso ft.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*******@disc ussions.microso ft.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, MessageBoxButto ns buttons, MessageBoxIcon icon) { MessageBox.Show (myError, "My Title", buttons, icon); }
.
Did you ever figure this out? What if you pass in the owner parameter?
Does that fix it?
m
"js" <ja***@nospam.c om> wrote in message news:<u9******* *******@TK2MSFT NGP11.phx.gbl>. .. I had the same problem. I'm sure I'm using single thread.
Anybody has the answer? -jason
"Drew Lettington" <an*******@disc ussions.microso ft.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*******@disc ussions.microso ft.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, > MessageBoxButto ns buttons, MessageBoxIcon icon) > { > MessageBox.Show (myError, "My > Title", > buttons, icon); > }
.
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 sizes properly so I know there is a
message in there. I also found a keyboard shortcut where <ctrl>+<insert>
will copy the contents of the messagebox to the clipboard in plain text. I
see my messagebox text in the clipboard contents but not in the...
|
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.) and would like to make the
dialog look and act like the standard MessageBox. Therefore, I would like to
put in the message section the same type of icons found in the MessageBox
dialog, such as MessageBoxIcon.Exclamation. In another post here I had...
|
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 like the solution used by MessageBox, where you call the static
Show() method, which
returns a DialogResult value...
|
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 bitching at .NET for the whole
day now not being able to do something as simple as showing a textbox's
content in a damn MessageBox...
The TextBox.Text is a String... MessageBox takes a LPCSTR (plain single byte
char*)... All our current code base...
|
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;
namespace Utils {
| |
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 works just
fine.
If I put the call in the .cpp file, I get the following two errors:
error C2653: 'MessageBoxA': is not a class or namespace name
error C2660: 'System::Windows::Forms::Control::Show': function does not take
|
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 like it
could help, both in the VS help and in this NG. I found lots of
examples of people saying how easy it is and showing examples, and
examples in the help. But I have two problems:
1. All the examples show all the code in HTML, usually...
|
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 MessageBox.Show
function, in my laptop, the code doesn't get past the inner loop where
there is a Thread.Sleep(10).
Here is the code. Does anyone know why? Thanks.
private void APRun()
{
|
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, minimizes the MDI form. Why is this happening and how can I prevent it?
Important thing to say is, if I use just "OK" MessageBox, it DOES NOT minimize the MDI parent.
TIA
Goran
|
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 AppDomain.CurrentDomain.UnhandledException or
System.Windows.Application.Current.DispatcherUnhandledException event
handlers handle any errors.
In the error handling routine, I can call MessageBox.Show to display
an error message to the user. This kinda works, as the messagebox
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |