This documentation is archived and is not being maintained.

MessageBox.Show Method (IWin32Window, String)

.NET Framework 1.1

Displays a message box in front of the specified object and with the specified text.

[Visual Basic]
Overloads Public Shared Function Show( _
   ByVal owner As IWin32Window, _
   ByVal text As String _
) As DialogResult
public static DialogResult Show(
 IWin32Window owner,
 string text
public: static DialogResult Show(
 IWin32Window* owner,
 String* text
public static function Show(
   owner : IWin32Window,
 text : String
) : DialogResult;


The IWin32Window the message box will display in front of.
The text to display in the message box.

Return Value

One of the DialogResult values.


You can use the owner parameter to specify a particular object, which implements the IWin32Window interface, to place the message box in front of. A message box is a modal dialog, which means no input (keyboard or mouse click) can occur except to objects on the modal form. The program must hide or close a modal form (typically in response to some user action) before input to another form can occur.

By default, the message box displays an OK button. The message box does not contain a caption in the title.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

.NET Framework Security: 

See Also

MessageBox Class | MessageBox Members | System.Windows.Forms Namespace | MessageBox.Show Overload List