Questions tagged [messagebox]

A message box is a prefabricated modal dialog box that displays a text message to a user.

1743 questions
383
votes
9 answers

Is there a MessageBox equivalent in WPF?

Is there a standard message box in WPF, like WinForms' System.Windows.Forms.MessageBox.Show(), or should I use the WinForms message box?
Makach
  • 6,940
  • 6
  • 25
  • 36
160
votes
21 answers

Show a popup/message box from a Windows batch file

Is there a way to display a message box from a batch file (similar to how xmessage can be used from bash-scripts in Linux)?
billyy
  • 2,137
  • 3
  • 17
  • 13
134
votes
9 answers

How to pop an alert message box using PHP?

How to pop an alert message box using PHP?
adil
  • 1,387
  • 2
  • 9
  • 4
86
votes
14 answers

Close a MessageBox after several seconds

I have a Windows Forms application VS2010 C# where I display a MessageBox for show a message. I have an okay button, but if they walk away, I want to timeout and close the message box after lets say 5 seconds, automatically close the message…
Kiquenet
  • 13,271
  • 31
  • 133
  • 232
81
votes
4 answers

How to add message box with 'OK' button?

I want to display a message box with an OK button. I used the following code but it results in a compile error with argument: AlertDialog.Builder dlgAlert = new AlertDialog.Builder(this); dlgAlert.setMessage("This is an alert with no…
Rajkumar Reddy
  • 2,289
  • 6
  • 21
  • 29
70
votes
4 answers

How to change the button text for 'Yes' and 'No' buttons in the MessageBox.Show dialog?

I need to change the message box control buttons Yes to Continue and No to Close. How do I change the button text? Here is my code: DialogResult dlgResult = MessageBox.Show("Patterns have been logged successfully", "Logtool",…
bala3569
  • 10,040
  • 28
  • 92
  • 141
64
votes
6 answers

center MessageBox in parent form

Is there a easy way to center MessageBox in parent form in .net 2.0
Ramji
  • 2,396
  • 7
  • 32
  • 50
56
votes
5 answers

C# MessageBox dialog result

I want to make a MessageBox confirmation. Here is the message box: MessageBox.Show("Do you want to save changes?", "Confirmation", messageBoxButtons.YesNoCancel); And I want to make something like this (in pseudocode): if (MessageBox.Result ==…
biox
  • 1,306
  • 2
  • 15
  • 25
52
votes
5 answers

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

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…
Greg
  • 31,898
  • 75
  • 232
  • 424
50
votes
9 answers

MessageBox with YesNoCancel - No & Cancel triggers same event

I have a message box with the YesNoCancel buttons... Pressing Yes will do some action and close the application - works fine Pressing No will do nothing and close the application - (see below) Pressing Cancel will do nothing and keep the…
Bibhas Debnath
  • 13,319
  • 14
  • 64
  • 93
48
votes
5 answers

Why isn't MessageBox TopMost?

I recently found out that by default MessageBoxes were not the top most form when displayed by default and I was wondering if anyone knew any circumstances when you wouldn't want the messagebox to be shown on top of other windows? I found the issue…
Sayse
  • 38,955
  • 14
  • 69
  • 129
47
votes
4 answers

How do i get an Image for the various MessageBoxImage(s) or MessageBoxIcon(s)

How do i get an System.Drawing.Image for the various System.Windows.MessageBoxImage(s) and/or System.Windows.Forms.MessageBoxIcon(s)
Simon
  • 30,844
  • 15
  • 120
  • 187
46
votes
12 answers

How have you successfully implemented MessageBox.Show() functionality in MVVM?

I've got a WPF application which calls MessageBox.Show() way back in the ViewModel (to check if the user really wants to delete). This actually works, but goes against the grain of MVVM since the ViewModel should not explicitly determine what…
Edward Tanguay
  • 176,854
  • 291
  • 683
  • 1,015
45
votes
5 answers

WPF MessageBox window style

How to apply the default Windows style to the standard MessageBox in WPF? For example, when I execute next code: MessageBox.Show("Hello Stack Overflow!", "Test", MessageBoxButton.OKCancel, MessageBoxImage.Exclamation); I'm getting message…
Kyrylo M
  • 10,931
  • 7
  • 43
  • 75
34
votes
4 answers

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…
Dan Tao
  • 119,009
  • 50
  • 280
  • 431
1
2 3
99 100