Compartilhar via


IUIService.ShowMessage Método

Definição

Exibe a mensagem especificada em uma caixa de mensagem.

Sobrecargas

ShowMessage(String)

Exibe a mensagem especificada em uma caixa de mensagem.

ShowMessage(String, String)

Exibe a mensagem especificada em uma caixa de mensagem com a legenda especificada.

ShowMessage(String, String, MessageBoxButtons)

Exibe a mensagem especificada em uma caixa de mensagem com a legenda e os botões especificados a colocar na caixa de diálogo.

ShowMessage(String)

Exibe a mensagem especificada em uma caixa de mensagem.

public:
 void ShowMessage(System::String ^ message);
public void ShowMessage (string message);
abstract member ShowMessage : string -> unit
Public Sub ShowMessage (message As String)

Parâmetros

message
String

A mensagem a ser exibida.

Exemplos

O exemplo de código a seguir demonstra como usar o ShowMessage método para exibir uma caixa de mensagem.

IUIService^ UIservice = dynamic_cast<IUIService^>(this->GetService( System::Windows::Forms::Design::IUIService::typeid ));
if ( UIservice != nullptr )
      UIservice->ShowMessage( "Test message", "Test caption", System::Windows::Forms::MessageBoxButtons::AbortRetryIgnore );
IUIService UIservice = (IUIService)this.GetService( 
    typeof( System.Windows.Forms.Design.IUIService ) );
if( UIservice != null )            
    UIservice.ShowMessage("Test message", "Test caption", 
        System.Windows.Forms.MessageBoxButtons.AbortRetryIgnore);
Dim UIservice As IUIService = CType(Me.GetService( _
    GetType(System.Windows.Forms.Design.IUIService)), IUIService)
If (UIservice IsNot Nothing) Then
    UIservice.ShowMessage("Test message", "Test caption", _
        System.Windows.Forms.MessageBoxButtons.AbortRetryIgnore)
End If

Comentários

Esse método garante que a exibição da caixa de mensagem esteja integrada corretamente ao ambiente de desenvolvimento.

Aplica-se a

ShowMessage(String, String)

Exibe a mensagem especificada em uma caixa de mensagem com a legenda especificada.

public:
 void ShowMessage(System::String ^ message, System::String ^ caption);
public void ShowMessage (string message, string caption);
abstract member ShowMessage : string * string -> unit
Public Sub ShowMessage (message As String, caption As String)

Parâmetros

message
String

A mensagem a ser exibida.

caption
String

A legenda da caixa de mensagem.

Exemplos

O exemplo de código a seguir tenta obter uma instância do IUIService método e invocar o serviço ShowMessage .

IUIService^ UIservice = dynamic_cast<IUIService^>(this->GetService( System::Windows::Forms::Design::IUIService::typeid ));
if ( UIservice != nullptr )
      UIservice->ShowMessage( "Test message", "Test caption", System::Windows::Forms::MessageBoxButtons::AbortRetryIgnore );
IUIService UIservice = (IUIService)this.GetService( 
    typeof( System.Windows.Forms.Design.IUIService ) );
if( UIservice != null )            
    UIservice.ShowMessage("Test message", "Test caption", 
        System.Windows.Forms.MessageBoxButtons.AbortRetryIgnore);
Dim UIservice As IUIService = CType(Me.GetService( _
    GetType(System.Windows.Forms.Design.IUIService)), IUIService)
If (UIservice IsNot Nothing) Then
    UIservice.ShowMessage("Test message", "Test caption", _
        System.Windows.Forms.MessageBoxButtons.AbortRetryIgnore)
End If

Comentários

Esse método garante que a exibição da caixa de mensagem esteja integrada corretamente ao ambiente de desenvolvimento.

Aplica-se a

ShowMessage(String, String, MessageBoxButtons)

Exibe a mensagem especificada em uma caixa de mensagem com a legenda e os botões especificados a colocar na caixa de diálogo.

public:
 System::Windows::Forms::DialogResult ShowMessage(System::String ^ message, System::String ^ caption, System::Windows::Forms::MessageBoxButtons buttons);
public System.Windows.Forms.DialogResult ShowMessage (string message, string caption, System.Windows.Forms.MessageBoxButtons buttons);
abstract member ShowMessage : string * string * System.Windows.Forms.MessageBoxButtons -> System.Windows.Forms.DialogResult
Public Function ShowMessage (message As String, caption As String, buttons As MessageBoxButtons) As DialogResult

Parâmetros

message
String

A mensagem a ser exibida.

caption
String

A legenda da caixa de diálogo.

buttons
MessageBoxButtons

Um dos valores de MessageBoxButtons: OK, OKCancel, YesNo ou YesNoCancel.

Retornos

DialogResult

Um dos valores de DialogResult que indica o código de resultado retornado pela caixa de diálogo.

Exemplos

O exemplo de código a seguir demonstra como usar o ShowMessage método para exibir uma caixa de mensagem.

IUIService^ UIservice = dynamic_cast<IUIService^>(this->GetService( System::Windows::Forms::Design::IUIService::typeid ));
if ( UIservice != nullptr )
      UIservice->ShowMessage( "Test message", "Test caption", System::Windows::Forms::MessageBoxButtons::AbortRetryIgnore );
IUIService UIservice = (IUIService)this.GetService( 
    typeof( System.Windows.Forms.Design.IUIService ) );
if( UIservice != null )            
    UIservice.ShowMessage("Test message", "Test caption", 
        System.Windows.Forms.MessageBoxButtons.AbortRetryIgnore);
Dim UIservice As IUIService = CType(Me.GetService( _
    GetType(System.Windows.Forms.Design.IUIService)), IUIService)
If (UIservice IsNot Nothing) Then
    UIservice.ShowMessage("Test message", "Test caption", _
        System.Windows.Forms.MessageBoxButtons.AbortRetryIgnore)
End If

Comentários

Esse método garante que a exibição da caixa de mensagem esteja integrada corretamente ao ambiente de desenvolvimento.

Confira também

Aplica-se a