Redigera

Dela via


IUIService.ShowDialog(Form) Method

Definition

Attempts to display the specified form in a dialog box.

public:
 System::Windows::Forms::DialogResult ShowDialog(System::Windows::Forms::Form ^ form);
public System.Windows.Forms.DialogResult ShowDialog (System.Windows.Forms.Form form);
abstract member ShowDialog : System.Windows.Forms.Form -> System.Windows.Forms.DialogResult
Public Function ShowDialog (form As Form) As DialogResult

Parameters

form
Form

The Form to display.

Returns

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

Examples

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

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( 
    typeof( System.Windows.Forms.Design.IUIService ) );
if( UIservice != null )            
    UIservice.ShowDialog(new ExampleForm());
Dim UIservice As IUIService = CType(Me.GetService( _
    GetType(System.Windows.Forms.Design.IUIService)), IUIService)
If (UIservice IsNot Nothing) Then
    UIservice.ShowDialog(New ExampleForm())
End If

Applies to

See also