다음을 통해 공유


WindowsCollection 인터페이스

현재 열려 있는 각 Microsoft Office InfoPath 2003 창에 대한 WindowObject 개체를 포함합니다.

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

구문

<GuidAttribute("096CD58B-0786-11D1-95FA-0080C78EE3BB")> _
<CoClassAttribute(GetType(WindowsCollectionClass))> _
Public Interface WindowsCollection
    Inherits Windows

Dim instance As WindowsCollection
[GuidAttribute("096CD58B-0786-11D1-95FA-0080C78EE3BB")] 
[CoClassAttribute(typeof(WindowsCollectionClass))] 
public interface WindowsCollection : Windows

주의

이 형식은 COM 상호 운용성을 위해 관리 코드에 필요한 coclass에 의해 구현되는 COM 인터페이스에 대한 래퍼입니다. 이 인터페이스에서 지정한 구성원에 액세스하려면 이 인터페이스를 구현하는 coclass를 래핑하는 형식을 사용하십시오. 사용법, 주의 사항, 예제와 같은 coclass 인터페이스에 대한 자세한 내용은 다음을 참고하십시오. Windows.

WindowObject 개체는 InfoPath 응용 프로그램에 사용되는 두 가지 유형의 창을 나타냅니다. 하나는 양식에 입력할 때 양식 영역으로 사용되는 편집 창이고, 다른 하나는 양식을 디자인할 때 디자인 모드로 사용되는 디자인 창입니다.

WindowsCollection 컬렉션은 양식의 연결된 Window 개체에 액세스하는 데 사용할 수 있는 속성을 구현하며 Application 개체의 Windows 속성을 통해 액세스할 수 있습니다.

참고:

WindowsCollection 컬렉션은 포함된 WindowObject 개체 수를 가져오거나 지정된 WindowObject 개체에 대한 참조 반환에만 사용할 수 있으며 WindowObject 개체 작성, 추가 또는 제거에는 사용할 수 없습니다.

예제

양식의 단추에 대한 OnClick 이벤트 처리기로 구현된 다음 예제에서는 Application 개체의 Windows 속성을 사용하여 WindowsCollection 컬렉션에 대한 참조를 설정합니다. 그런 다음 컬렉션 전체에서 반복하고 컬렉션에 포함된 각 Window 개체의 형식을 표시합니다.

public void ShowWindowTypes_OnClick(DocActionEvent e)
{
// Set a reference to the Windows collection.
WindowsCollection windows = thisApplication.Windows;

// Loop through the collection and display the type
// of each Window object that it contains.
for (int i=0; i < windows.Count; i++)
 {
string windowType = "";

switch (windows[i].WindowType)
    {
    case XdWindowType.xdEditorWindow:
    windowType = "Editing window";
    break;

    case XdWindowType.xdDesignerWindow:
    windowType = "Designing window";
    break;
    }

thisXDocument.UI.Alert("Window type " + i + ": " + windowType);
 }
}

코드 예제를 보려면 방법: 양식 창 사용을 참고하십시오.

참고 항목

참조

WindowsCollection 구성원
Microsoft.Office.Interop.InfoPath 네임스페이스