messagebox

MessageBox doesn't show on mdi form after a long calculation

Hello This is a very similar problem to This one, sadly that one was never answered either. I have a MDI Main forum that hosts several children forms. One of them does a long calculation and throws an exception if an error occurs (all work is done on the same thread). I then try to inform the user of an error with an messagebox, howeve...

Console app showing message box on error

I am trying to integrate with a vendors app by calling it with command args from c#. It is meant to automate a process that we need to do with out needing anyone to interact with the application. If there are no errors when running the process it works fine. However if there are any errors the vendors application will show a message box...

Winforms-How can I make MessageBox appear centered on MainForm?

Hi Winforms-How can I make dialog boxes appear centered on MainForm? That is as opposed to be based on Normal windows default which renders them in the centre of the screen. In my case I have a small main form that may for example be positioned in a corner, the the MessageBox popup is displayed what seems a ways away. ...

Problems related to showing MessageBox from non-GUI threads

I'm working on a heavily data-bound Win.Forms application where I've found some strange behavior. The app has separate I/O threads receiving updates through asynchronous web-requests which it then sends to the main/GUI thread for processing and updating of application-wide data-stores (which in turn may be data-bound to various GUI-eleme...

WPF BackgroundWorker process RunWorkerCompleted is called multiple times, why?

I have some code that starts a background process for search in my WPF application: private void RunSearch(SearchArguments arguments) { _getSearchResults.DoWork += GetSarchFromDb; _getSearchResults.RunWorkerCompleted += SearchFinished; _getSearchResults.RunWorkerAsync(arguments); } RunSearch is exicute...

MessageBox.Show(TimeSpan)

i would like to show a TimeSpan in a MessageBox but am getting an error: DateTime date1 = new DateTime(byear, bmonth, bday, 0, 0, 0); DateTime datenow = DateTime.Now; TimeSpan age = datenow - date1; MessageBox.Show(ToString(age)); Error 1 No overload for method 'ToString' takes '1' arguments how do i output a messagebox with Ti...

NSRunAlertPanel shows up behind the "active window"

I'm trying to put together a simple error reporting package. If my main program crashes, it saves a crashlog, then starts a reporter program. The reporter program asks the user if it can send the crash log to me, then does so. I'm using NSRunAlertPanel to create a basic message box. For some reason, that message box is showing up buried...

Why do escape characters break my Telerik call to ResponseScripts.Add(string)?

this displays the expected javascript alert message box: RadAjaxManager1.ResponseScripts.Add("alert('blahblahblah');"); while these does not: RadAjaxManager1.ResponseScripts.Add("alert('blahblah \n blahblahblah');"); RadAjaxManager1.ResponseScripts.Add("alert('blahblah \r blahblahblah');"); RadAjaxManager1.ResponseScripts.Add("alert(...

RetryCancel MessageBox

Im using System.Windows.MessageBox.Show() to display a dialog to the user. One overload lets me set the buttons that appear using the System.Windows.MessageBoxButton enum. However, it seems to lack a RetryCancel option that my googling suggests it should have. Am I missing something? How do I display a RetryCancel messagebox? ...

Centralizing Messagebox handling for application

I'm wondering how others deal with trying to centralize MessageBox function calling. Instead of having long text embedded all over the place in code, in the past (non .net language), I would put system and application base "messagebox" type of messages into a database file which would be "burned" into the executable, much like a resourc...

window.location call popup up empty dialog on safari

Hi, on a web page i am trying to redirect the browser to another page on the same site. the code is very simple for that: window.location = "/path1/path2" on safari - both windows as well as mac - a message box containing only the text "http://domain.com" comes up. I have tried different ways of specifying this: location.href, wi...

Show a message box from a Windows Service

Can you display a message box (or any form of notification) from a windows service? Can't get it to work. I used: global::System.Windows.Forms.MessageBox.Show("A fatal error occurred. " + ServiceName + " is now terminating."); but it didn't work and just produced an error. ...

C# MessageBox Error Messages

Hello. In my application I am using message boxes to display error information. try { // Something... } catch (SystemException ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } This was fine at first, but as my program grows it becomes increasingly difficult to find the try-catch block wh...

Do I need to invoke MessageBox calls?

To pop-up a message box, I'm using MessageBox.Show(...). I usually wrap the call in an Invoke: BeginInvoke (new Action (() => { MessageBox.Show ()); })); (I removed a part of the original question which was answered elsewhere) Do I always need to wrap the MessageBox call in an (Begin-)Invoke if I'm calling from a non-GUI thread? ...

What is the difference between Invoking and BeginInvoking a MessageBox?

In a form, compare BeginInvoke (new Action (() => { MessageBox.Show ()); })); with Invoke (new Action (() => { MessageBox.Show ()); })); What is the difference, and when should I use one over the other? How is the behavior affected by the message pump of the MessageBox? I did some testing and found that both methods block ...

MessageBox.Show not raising HelpRequested event

I have a form that is showing a MessageBox using MessageBox.Show, and trying to receive events from the Help button on the MessageBox so I can execute my own code. The Microsoft documentation shows how to do this; however, using what is suggested does not work. Here's a shortened version of my code: Private Function MethodName() A...

Is there a non-blocking version of MessageBox.Show (or something like it)?

Long-delayed update I'm accepting MUG4N's answer to this question, and I also want to respond to some of the criticisms that were raised against it. ChrisF said: ...you can't make UI calls directly from background threads. This is a blanket statement, and is not 100% true. Let me just point out a few facts: You can actually mak...

Why does System.Windows.MessageBoxImage have enumeration sub-items with the same value?

Hi, I'm trying to write my own abstraction over the MessageBoxImage enumeration, and see that MessageBoxImage is defined as: namespace System.Windows { public enum MessageBoxImage { None = 0, Error = 16, Hand = 16, Stop = 16, Question = 32, Exclamation = 48, ...

MVC: User Message Stack implementations

How would you implement a user message stack in ASP.Net MVC? (you set messages for the user in any place inside your app. and they are shown as hints of your app to the user anywhere inside the app) I want to hear your ideas and thoughts. How would you do it? e.g.: ...

jquery: Flash messages

With jQuery, how can I display a flash message at the top of the page in an easy way? Is there something built-in, or a plugin, or is it easy enough to do it yourself? What I mean is like after a successful ajax post I would like to just say "hey, it went good" in a non-obtrusive way. ...