次の方法で共有


IUIService.ShowMessage メソッド

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

オーバーロードの一覧

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

[Visual Basic] Overloads Sub ShowMessage(String)

[C#] void ShowMessage(string);

[C++] void ShowMessage(String*);

[JScript] function ShowMessage(String);

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

[Visual Basic] Overloads Sub ShowMessage(String, String)

[C#] void ShowMessage(string, string);

[C++] void ShowMessage(String*, String*);

[JScript] function ShowMessage(String, String);

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

[Visual Basic] Overloads Function ShowMessage(String, String, MessageBoxButtons) As DialogResult

[C#] DialogResult ShowMessage(string, string, MessageBoxButtons);

[C++] DialogResult ShowMessage(String*, String*, MessageBoxButtons);

[JScript] function ShowMessage(String, String, MessageBoxButtons) : DialogResult;

使用例

[Visual Basic, C#, C++] メモ   ここでは、ShowMessage のオーバーロード形式のうちの 1 つだけについて、使用例を示します。その他の例については、各オーバーロード形式のトピックを参照してください。

 
Dim UIservice As IUIService = CType(Me.GetService( _
    GetType(System.Windows.Forms.Design.IUIService)), IUIService)
If Not (UIservice Is Nothing) Then
    UIservice.ShowMessage("Test message", "Test caption", _
        System.Windows.Forms.MessageBoxButtons.AbortRetryIgnore)
End If

[C#] 
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);

[C++] 
IUIService* UIservice = dynamic_cast<IUIService*>(this->GetService(__typeof(System::Windows::Forms::Design::IUIService)));
if (UIservice != 0)
   UIservice->ShowMessage(S"Test message", S"Test caption", System::Windows::Forms::MessageBoxButtons::AbortRetryIgnore);

[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

参照

IUIService インターフェイス | IUIService メンバ | System.Windows.Forms.Design 名前空間