Compartilhar via


_XDocumentEventSink2_Event.OnSwitchView Evento

Definição

Ocorre depois que uma exibição em um formulário do Microsoft InfoPath foi alternada com êxito.

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 

Tipo de evento

Exemplos

No exemplo a seguir, o manipulador de eventos OnSwitchView é usado para mostrar o nome do modo de exibição exibido quando ocorre a alteração de exibição:

[InfoPathEventHandler(EventType=InfoPathEventType.<span class="label">OnSwitchView</span>)]
public void OnSwitchView(DocEvent e)
{
 thisXDocument.UI.Alert("Loading the view " + thisXDocument.View.Name);
}

No exemplo a seguir, o manipulador de eventos OnSwitchView é usado para mostrar o nome do modo de exibição exibido quando ocorre a alteração de exibição:

[InfoPathEventHandler(EventType=InfoPathEventType.<span class="label">OnSwitchView</span>)]
public void OnSwitchView(DocEvent e)
{
 thisXDocument.UI.Alert("Loading the view " + thisXDocument.View.Name);
}

Comentários

Esse manipulador de eventos não permite que os usuários cancelem uma operação.

Observação: o evento OnSwitchView também ocorre quando um formulário é aberto pela primeira vez.

Aplica-se a