_XDocumentEventSink2_Event.OnSwitchView Événement
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Se produit après le basculement d’une vue dans un formulaire Microsoft InfoPath.
public:
event Microsoft::Office::Interop::InfoPath::SemiTrust::_XDocumentEventSink2_OnSwitchViewEventHandler ^ OnSwitchView;
event Microsoft.Office.Interop.InfoPath.SemiTrust._XDocumentEventSink2_OnSwitchViewEventHandler OnSwitchView;
member this.OnSwitchView : Microsoft.Office.Interop.InfoPath.SemiTrust._XDocumentEventSink2_OnSwitchViewEventHandler
Event OnSwitchView As _XDocumentEventSink2_OnSwitchViewEventHandler
Type d'événement
Exemples
Dans l’exemple suivant, le gestionnaire d’événements OnSwitchView est utilisé pour afficher le nom de la vue lorsque celle-ci change :
[InfoPathEventHandler(EventType=InfoPathEventType.<span class="label">OnSwitchView</span>)]
public void OnSwitchView(DocEvent e)
{
thisXDocument.UI.Alert("Loading the view " + thisXDocument.View.Name);
}
Dans l’exemple suivant, le gestionnaire d’événements OnSwitchView est utilisé pour afficher le nom de la vue lorsque celle-ci change :
[InfoPathEventHandler(EventType=InfoPathEventType.<span class="label">OnSwitchView</span>)]
public void OnSwitchView(DocEvent e)
{
thisXDocument.UI.Alert("Loading the view " + thisXDocument.View.Name);
}
Remarques
Ce gestionnaire d'événements ne permet pas aux utilisateurs d'annuler une opération.
Remarque : l’événement OnSwitchView se produit également lorsqu’un formulaire est ouvert pour la première fois.