This documentation is archived and is not being maintained.

MessageBox.Show Method (IWin32Window, String, String)

.NET Framework 1.1

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

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


The IWin32Window the message box will display in front of.
The text to display in the message box.
The text to display in the title bar of 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.


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