Questions tagged [messagebox]

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

1861 questions
9
votes
3 answers

Delphi messagebox appearing behind other form

I am using the code below to create a messagebox in Delphi 7. However I also have another form on screen who's FormStyle is set to fsStayOnTop and the messagebox appears behind this form. Is there any way to force the messagebox to appear in…
colin
  • 2,983
  • 6
  • 41
  • 49
9
votes
7 answers

How to display an error message box in a web application asp.net c#

I have an ASP.NET web application, and I wanted to know how I could display an error message box when an exception is thrown. For example, try { do something } catch { …
zohair
  • 2,369
  • 10
  • 35
  • 41
9
votes
6 answers

C# MessageBox Error Messages

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…
Jim Fell
  • 13,750
  • 36
  • 127
  • 202
9
votes
5 answers

Display a Variable in MessageBox c++

How to display a Variable in MessageBox c++ ? string name = "stackoverflow"; MessageBox(hWnd, "name is: ", "Msg title", MB_OK | MB_ICONQUESTION); I want to show it in the following way (#1): "name is: stackoverflow" and…
a7md0
  • 429
  • 2
  • 10
  • 20
9
votes
5 answers

MessageBox.Show right to left reading not working

Hey I'll make it simple. I want to make a MessageBox of this string "abc" and it will be read from right to left. I tried this Messagebox.Show("abc",MessageBoxOptions.RtlReading); what's worng with this ? this is the error i get : 1:"cannot…
Shmulik Cohen
  • 115
  • 2
  • 3
  • 7
9
votes
2 answers

Click on 'OK' button of message box using WinAPI in C#

I am trying to click on 'OK' button on a message box of C# Windows Forms using WinAPI . Below is the code that I am working on. private const int WM_CLOSE = 16; private const int BN_CLICKED = 245; [DllImport("user32.dll",…
Virus
  • 3,215
  • 7
  • 29
  • 46
9
votes
3 answers

MVVM Exception Handling

I have a WPF Application that I have been trying to write in the MVVM style. If an Exception is thrown (like when a document is opened), I would like to display a MessageBox. Easy to do, but my code doesn't feel quite right because the…
Jake Pearson
  • 27,069
  • 12
  • 75
  • 95
9
votes
2 answers

How to suppress a dialog box displayed by code that I can't change?

I have a Inproc COM Server from a 3rd party. One of the functions I call will display a error message dialog box if it traps a specific type of error. The issue is I am trying to process data in bulk, and the data source I am using is causing that…
Scott Chamberlain
  • 124,994
  • 33
  • 282
  • 431
8
votes
1 answer

Size of MessageBox

How does .NET's MessageBox determine its size relative to the resolution of the screen on which it is displayed? I am writing a slightly more flexible dialog window for a WPF application. The layout of the window is layed out in a…
Minustar
  • 1,185
  • 1
  • 10
  • 23
8
votes
4 answers

C# - MessageBox - Message localization in resources and lines breaks

I would like to show MessageBox (WinForms) with string from Resources with lines breaks. example without Resources (WORKS): string someMsg = "Message. Details:\n" + someDetails; MessageBox.Show(someMsg); Result: Message. Details: here are some…
binball
  • 2,255
  • 4
  • 30
  • 34
8
votes
3 answers

WPF: Does MessageBox Break PreviewMouseDown?

I've been trying to get my WPF application to prompt users to either discard their unsaved changes or to cancel when they navigate using a TreeView. How can I cancel a user’s WPF TreeView click? How do I properly handle a PreviewMouseDown event…
Zack Peterson
  • 56,055
  • 78
  • 209
  • 280
8
votes
3 answers

WPF MessageBox buttons aren't OS themed

So the buttons of my message box in WPF aren't themed by the OS. I even tried this method and it didn't work. I have a manifest, I am running under Windows 7 Ultimate x86 and .NET Framework 4 Client Profile. EDIT: It works now.
Vercas
  • 8,931
  • 15
  • 66
  • 106
8
votes
5 answers

how to create message box in public static void method

I have a public static method and I would like a message to be displayed if certain values are selected. This is in ASP.NET so adding using System.Windows.Forms; causes problems because I am using using System.Web.UI.WebControls;. So how do I create…
user123456789
  • 1,914
  • 7
  • 44
  • 100
8
votes
6 answers

how to create windows7-styled message/dialog boxes with command links in c#?

How to create these beautiful message/dialog boxes (example: http://i.msdn.microsoft.com/dynimg/IC123363.png) in C#? Is there a function similar to MessageBox.Show in the .NET Framework?
reaki
  • 81
  • 1
  • 3
8
votes
6 answers

C# Messagebox With ComboBox

How can I produce a messagebox in a C# Win Forms application that displays a combobox with a series of values to select as well as the usual "Ok" button? I would like to be able to trigger this on calling the MessageBox.Show() method. I am assuming…
Goober
  • 13,146
  • 50
  • 126
  • 195