IUIService.ShowMessage Método

Definición

Muestra el mensaje especificado en un cuadro de mensaje.

Sobrecargas

ShowMessage(String)

Muestra el mensaje especificado en un cuadro de mensaje.

ShowMessage(String, String)

Muestra el mensaje especificado en un cuadro de mensaje con el título especificado.

ShowMessage(String, String, MessageBoxButtons)

Muestra el mensaje especificado en un cuadro de mensaje con el título especificado y botones para colocar el cuadro de diálogo.

ShowMessage(String)

Muestra el mensaje especificado en un cuadro de mensaje.

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

Mensaje que se va a mostrar.

Ejemplos

En el ejemplo de código siguiente se muestra cómo usar el ShowMessage método para mostrar un cuadro de mensaje.

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

Comentarios

Este método garantiza que la presentación del cuadro de mensaje esté integrada correctamente con el entorno de desarrollo.

Se aplica a

ShowMessage(String, String)

Muestra el mensaje especificado en un cuadro de mensaje con el título especificado.

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

Mensaje que se va a mostrar.

caption
String

Título del cuadro de mensaje.

Ejemplos

En el ejemplo de código siguiente se intenta obtener una instancia de IUIService e invocar el método del ShowMessage servicio.

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

Comentarios

Este método garantiza que la presentación del cuadro de mensaje esté integrada correctamente con el entorno de desarrollo.

Se aplica a

ShowMessage(String, String, MessageBoxButtons)

Muestra el mensaje especificado en un cuadro de mensaje con el título especificado y botones para colocar el cuadro 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

Mensaje que se va a mostrar.

caption
String

Título del cuadro de diálogo.

buttons
MessageBoxButtons

Uno de los valores de MessageBoxButtons: OK, OKCancel, YesNo o YesNoCancel.

Devoluciones

Uno de los valores de DialogResult que indica el código de resultado que devuelve el cuadro de diálogo.

Ejemplos

En el ejemplo de código siguiente se muestra cómo usar el ShowMessage método para mostrar un cuadro de mensaje.

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

Comentarios

Este método garantiza que la presentación del cuadro de mensaje esté integrada correctamente con el entorno de desarrollo.

Consulte también

Se aplica a