다음을 통해 공유


_XDocumentEventSink2_Event.OnSwitchView 이벤트

Microsoft Office InfoPath 2007 양식에 있는 보기가 성공적으로 전환된 후에 발생합니다.

네임스페이스: Microsoft.Office.Interop.InfoPath.SemiTrust
어셈블리: Microsoft.Office.Interop.InfoPath.SemiTrust(microsoft.office.interop.infopath.semitrust.dll)

구문

Event OnSwitchView As _XDocumentEventSink2_OnSwitchViewEventHandler

Dim instance As _XDocumentEventSink2_Event
Dim handler As _XDocumentEventSink2_OnSwitchViewEventHandler

AddHandler instance.OnSwitchView, handler
event _XDocumentEventSink2_OnSwitchViewEventHandler OnSwitchView

주의

이 이벤트 처리기를 사용할 때는 작업을 취소할 수 없습니다.

참고:

OnSwitchView 이벤트는 양식을 처음 열었을 때도 발생합니다.

예제

다음 예제에서는 OnSwitchView 이벤트 처리기를 사용하여 보기가 변경될 때 나타나는 보기의 이름을 표시합니다.

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

참고 항목

참조

_XDocumentEventSink2_Event 인터페이스
_XDocumentEventSink2_Event 구성원
Microsoft.Office.Interop.InfoPath.SemiTrust 네임스페이스