LoadingEventArgs.SetDefaultView, méthode (ViewInfo)
Définit la vue par défaut du formulaire en spécifiant un objet ViewInfo.
Espace de noms : Microsoft.Office.InfoPath
Assembly : Microsoft.Office.InfoPath (dans Microsoft.Office.InfoPath.dll)
Syntaxe
'Déclaration
Public MustOverride Sub SetDefaultView ( _
view As ViewInfo _
)
'Utilisation
Dim instance As LoadingEventArgs
Dim view As ViewInfo
instance.SetDefaultView(view)
public abstract void SetDefaultView(
ViewInfo view
)
Paramètres
- view
Type : Microsoft.Office.InfoPath.ViewInfo
Objet ViewInfo qui spécifie la vue.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | Le paramètre passé à cette méthode est une référence NULL (Nothing dans Visual Basic). |
ArgumentException | Le paramètre passé à cette méthode n'est pas valide. Par exemple, le type ou le format est incorrect. |
Remarques
Ce type ou ce membre est accessible à partir du code exécuté dans les formulaires ouverts dans Microsoft InfoPath Filler ou dans un navigateur Web.
Exemples
L'exemple suivant utilise la méthode SetDefaultView(Microsoft.Office.InfoPath.ViewInfo) dans le gestionnaire d'événements Loading pour définir la deuxième vue de la collection ViewInfoCollection comme vue par défaut.
public void FormEvents_Loading(object sender, LoadingEventArgs e)
{
e.SetDefaultView(ViewInfos[1]);
}
Public Sub FormEvents_Loading(ByVal sender As Object, _
ByVal e As LoadingEventArgs)
e.SetDefaultView(ViewInfos(1))
End Sub