Freigeben über


IUIService.ShowDialog-Methode

Versucht, das angegebene Formular in einem Dialogfeld anzuzeigen.

Namespace: System.Windows.Forms.Design
Assembly: System.Windows.Forms (in system.windows.forms.dll)

Syntax

'Declaration
Function ShowDialog ( _
    form As Form _
) As DialogResult
'Usage
Dim instance As IUIService
Dim form As Form
Dim returnValue As DialogResult

returnValue = instance.ShowDialog(form)
DialogResult ShowDialog (
    Form form
)
DialogResult ShowDialog (
    Form^ form
)
DialogResult ShowDialog (
    Form form
)
function ShowDialog (
    form : Form
) : DialogResult

Parameter

  • form
    Das anzuzeigende Form.

Rückgabewert

Einer der DialogResult-Werte, der den vom Dialogfeld zurückgegebenen Ergebniscode angibt.

Beispiel

Im folgenden Codebeispiel wird versucht, eine Instanz der IUIService-Klasse abzurufen und die ShowDialog-Methode des Diensts aufzurufen.

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
IUIService UIservice = (IUIService)this.GetService( 
    typeof( System.Windows.Forms.Design.IUIService ) );
if( UIservice != null )            
    UIservice.ShowDialog(new ExampleForm());
IUIService^ UIservice = dynamic_cast<IUIService^>(this->GetService( System::Windows::Forms::Design::IUIService::typeid ));
if ( UIservice != nullptr )
      UIservice->ShowDialog( gcnew ExampleForm );
IUIService uiService = (IUIService)this.GetService(System.Windows.
    Forms.Design.IUIService.class.ToType());
if (uiService != null) {
    uiService.ShowDialog(new ExampleForm());
}

Plattformen

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.

Versionsinformationen

.NET Framework

Unterstützt in: 2.0, 1.1, 1.0

Siehe auch

Referenz

IUIService-Schnittstelle
IUIService-Member
System.Windows.Forms.Design-Namespace
DialogResult