Este artigo foi traduzido por máquina. Para visualizar o arquivo em inglês, marque a caixa de seleção Inglês. Você também pode exibir o texto Em inglês em uma janela pop-up, movendo o ponteiro do mouse sobre o texto.
|
Tradução
Inglês
|
Método MessageBox.Show (IWin32Window, String, String, MessageBoxButtons, MessageBoxIcon, MessageBoxDefaultButton, MessageBoxOptions, String, HelpNavigator)
![]() |
---|
The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience. |
Assembly: System.Windows.Forms (em System.Windows.Forms.dll)
public static DialogResult Show( IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, string helpFilePath, HelpNavigator navigator )
Parâmetros
- owner
-
Type:
System.Windows.Forms.IWin32Window
Uma implementação de IWin32Window que possuirá a caixa de diálogo modal.
- text
-
Type:
System.String
O texto a ser exibido na caixa de mensagem.
- caption
-
Type:
System.String
O texto a ser exibido na barra de título da caixa de mensagem.
- buttons
-
Type:
System.Windows.Forms.MessageBoxButtons
Uma da MessageBoxButtons valores que especifica quais botões devem ser exibidos na caixa de mensagem.
- icon
-
Type:
System.Windows.Forms.MessageBoxIcon
Uma da MessageBoxIcon valores que especifica qual ícone será exibido na caixa de mensagem.
- defaultButton
-
Type:
System.Windows.Forms.MessageBoxDefaultButton
Uma da MessageBoxDefaultButton valores que especifica o botão padrão da caixa de mensagem.
- options
-
Type:
System.Windows.Forms.MessageBoxOptions
Uma da MessageBoxOptions valores que especifica quais opções de exibição e associação serão usadas para a caixa de mensagem. Você pode passar 0 se você quiser usar os padrões.
- helpFilePath
-
Type:
System.String
O caminho e o nome do arquivo de ajuda a ser exibido quando o usuário clica no botão Ajuda.
- navigator
-
Type:
System.Windows.Forms.HelpNavigator
Um dos valores de HelpNavigator.
Exception | Condition |
---|---|
InvalidEnumArgumentException | |
InvalidOperationException | |
ArgumentException |
using System; using System.Drawing; using System.ComponentModel; using System.Windows.Forms;
// Display message box parented to the main form. // The Help button opens the Mspaint.chm Help file // and shows the Help contents on the Index tab. DialogResult r4 = MessageBox.Show (this, "Message with Help file and Help navigator.", "Help Caption", MessageBoxButtons.OK, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1, 0, "mspaint.chm", HelpNavigator.Index);
for safe subwindows to call this method. Associated enumeration: F:System.Security.Permissions.UIPermissionWindow.SafeSubWindows
to access a HTML help file through a HTTP request. Associated enumeration: F:System.Net.NetworkAccess.Connect
to access a HTML help file not served from a HTTP server. Associated enumeration: F:System.Security.Permissions.SecurityPermissionFlag.UnmanagedCode
for safe subwindows to call this method. Associated enumeration: F:System.Security.Permissions.UIPermissionWindow.SafeSubWindows
Disponível desde 2.0