Langue

IUIService.ShowDialog(Form) Méthode

Définition

Tente d’afficher le formulaire spécifié dans une boîte de dialogue.

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

Paramètres

form
Form

À Form afficher.

Retours

Une des DialogResult valeurs indiquant le code de résultat retourné par la boîte de dialogue.

Exemples

L’exemple de code suivant tente d’obtenir une instance de la IUIService classe et d’appeler la méthode du ShowDialog service.

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

S’applique à

Voir aussi