Share via


IUIService.ShowMessage メソッド

定義

指定したメッセージをメッセージ ボックスに表示します。

オーバーロード

ShowMessage(String)

指定したメッセージをメッセージ ボックスに表示します。

ShowMessage(String, String)

キャプションを指定して、指定したメッセージをメッセージ ボックスに表示します。

ShowMessage(String, String, MessageBoxButtons)

キャプションおよびダイアログ ボックスに配置するボタンを指定して、指定したメッセージをメッセージ ボックスに表示します。

ShowMessage(String)

指定したメッセージをメッセージ ボックスに表示します。

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

パラメーター

message
String

表示するメッセージ。

次のコード例では、 メソッドを使用 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

注釈

この方法により、メッセージ ボックスの表示が開発環境と適切に統合されます。

適用対象

ShowMessage(String, String)

キャプションを指定して、指定したメッセージをメッセージ ボックスに表示します。

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)

パラメーター

message
String

表示するメッセージ。

caption
String

メッセージ ボックスのキャプション。

次のコード例では、 の IUIService インスタンスを取得し、サービスの 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

注釈

この方法により、メッセージ ボックスの表示が開発環境と適切に統合されます。

適用対象

ShowMessage(String, String, MessageBoxButtons)

キャプションおよびダイアログ ボックスに配置するボタンを指定して、指定したメッセージをメッセージ ボックスに表示します。

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

パラメーター

message
String

表示するメッセージ。

caption
String

ダイアログ ボックスのキャプション。

buttons
MessageBoxButtons

MessageBoxButtons 値、つまり OKOKCancelYesNo、または YesNoCancel の 1 つ。

戻り値

ダイアログ ボックスから返された結果コードを示す DialogResult 値の 1 つ。

次のコード例では、 メソッドを使用 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

注釈

この方法により、メッセージ ボックスの表示が開発環境と適切に統合されます。

こちらもご覧ください

適用対象