This documentation is archived and is not being maintained.

IUIService.ShowDialog Method

Attempts to display the specified form in a dialog box.

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

DialogResult ShowDialog (
	Form form
)
DialogResult ShowDialog (
	Form form
)
function ShowDialog (
	form : Form
) : DialogResult

Parameters

form

The Form to display.

Return Value

One of the DialogResult values indicating the result code returned by the dialog box.

The following code example attempts to obtain an instance of the IUIService class and invoke the service's ShowDialog method.

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

IUIService uiService = (IUIService)this.GetService(System.Windows.
    Forms.Design.IUIService.class.ToType());
if (uiService != null) {
    uiService.ShowDialog(new ExampleForm());
}

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

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0
Show: