次の方法で共有


IUIService.ShowMessage メソッド (String, String, MessageBoxButtons)

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

Function ShowMessage( _
   ByVal message As String, _   ByVal caption As String, _   ByVal buttons As MessageBoxButtons _) As DialogResult
[C#]
DialogResult ShowMessage(
   stringmessage,stringcaption,MessageBoxButtonsbuttons);
[C++]
DialogResult ShowMessage(
   String* message,String* caption,MessageBoxButtonsbuttons);
[JScript]
function ShowMessage(
   message : String,caption : String,buttons : MessageBoxButtons) : DialogResult;

パラメータ

戻り値

ダイアログ ボックスから返された結果コードを示す DialogResult 値の 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++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

必要条件

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ

参照

IUIService インターフェイス | IUIService メンバ | System.Windows.Forms.Design 名前空間 | IUIService.ShowMessage オーバーロードの一覧 | DialogResult | MessageBox