다음을 통해 공유


DTE2.ActiveWindow 속성

현재 활성 창 또는 활성 창이 없는 경우 맨 위의 창을 가져옵니다.

네임스페이스:  EnvDTE80
어셈블리:  EnvDTE80(EnvDTE80.dll)

구문

‘선언
ReadOnly Property ActiveWindow As Window
Window ActiveWindow { get; }
property Window^ ActiveWindow {
    Window^ get ();
}
abstract ActiveWindow : Window with get
function get ActiveWindow () : Window

속성 값

형식: Window
Window 개체열려 있는 창이 없으면 Nothing을 반환합니다.

설명

ActiveWindow는 환경의 활성 창을 반환합니다.

도구 창에서만 캡션을 설정할 수 있습니다. 문서 창 등의 다른 창 형식에서 캡션을 설정하려고 시도하는 경우, "알 수 없는 오류입니다"라는 오류가 나타납니다.

예제

Sub ActiveWindowExample(ByVal dte As DTE2)

    ' Create two text files.
    Dim doc1 As Document = _
        dte.ItemOperations.NewFile(, "Document1").Document
    dte.ItemOperations.NewFile(, "Document2")

    MsgBox("The active window is " & dte.ActiveWindow.Caption)

    If MsgBox("Activate Document1?", MsgBoxStyle.YesNo) = _
        MsgBoxResult.Yes Then
        doc1.Activate()
    End If

    MsgBox("The active window is " & dte.ActiveWindow.Caption)

End Sub
public void ActiveWindowExample(DTE2 dte)
{
    // Create two text files.
    Document doc1 = dte.ItemOperations.NewFile(@"General\Text File", 
        "Document1", Constants.vsViewKindPrimary).Document;
    dte.ItemOperations.NewFile(@"General\Text File", "Document2", 
        Constants.vsViewKindPrimary);

    MessageBox.Show("The active window is " + 
        dte.ActiveWindow.Caption);

    if (MessageBox.Show("Activate Document1?", "", 
        MessageBoxButtons.YesNo) == DialogResult.Yes)
        doc1.Activate();

    MessageBox.Show("The active window is " + 
        dte.ActiveWindow.Caption);
}

.NET Framework 보안

참고 항목

참조

DTE2 인터페이스

EnvDTE80 네임스페이스

기타 리소스

방법: 자동화 개체 모델 코드의 예제 컴파일 및 실행