次の方法で共有


IUIService.ShowDialog メソッド

指定したフォームをダイアログ ボックスに表示しようとします。

Function ShowDialog( _
   ByVal form As Form _) As DialogResult
[C#]
DialogResult ShowDialog(
   Formform);
[C++]
DialogResult ShowDialog(
   Form* form);
[JScript]
function ShowDialog(
   form : Form) : DialogResult;

パラメータ

  • form
    表示する Form

戻り値

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

使用例

[Visual Basic, C#, C++] IUIService クラスのインスタンスを取得し、サービスの ShowDialog メソッドを呼び出すコード例を次に示します。

 
Dim UIservice As IUIService = CType(Me.GetService( _
    GetType(System.Windows.Forms.Design.IUIService)), IUIService)
If Not (UIservice Is Nothing) Then
    UIservice.ShowDialog(New ExampleForm())
End If

[C#] 
IUIService UIservice = (IUIService)this.GetService( 
    typeof( System.Windows.Forms.Design.IUIService ) );
if( UIservice != null )            
    UIservice.ShowDialog(new ExampleForm());

[C++] 
IUIService* UIservice = dynamic_cast<IUIService*>(this->GetService(__typeof(System::Windows::Forms::Design::IUIService)));
if (UIservice != 0)
   UIservice->ShowDialog(new ExampleForm());

[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 名前空間 | DialogResult