مشاركة عبر


_DTE.ActiveWindow الخاصية

إرجاع حاليا نافذة نشطة، أو الإطار الأعلى إذا كان لا يوجد البعض الآخر غير نشطة.

مساحة الاسم:  EnvDTE
التجميع:  EnvDTE (في EnvDTE.dll)

بناء الجملة

'إقرار
ReadOnly Property ActiveWindow As Window
    Get
Window ActiveWindow { get; }
property Window^ ActiveWindow {
    Window^ get ();
}
abstract ActiveWindow : Window
function get ActiveWindow () : Window

قيمة الخاصية

النوع: EnvDTE.Window
كائن Window .إرجاع Nothingفي حالة لا إطارات مفتوحة.

ملاحظات

ActiveWindowإرجاع بيئة النشطة نافذة.

يمكنك تعيين تسمية توضيحية تشغيل أداة Windows فقط. إذا حاولت تعيين التسمية التوضيحية تشغيل غير ذلك الإطار أنواع، مثل المستندات، يمكنك الحصول تشغيل خطأ، "خطأ غير محدد."

أمثلة

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.

راجع أيضًَا

المرجع

_DTE واجهة

_DTE الأعضاء

EnvDTE مساحة الاسم

موارد أخرى

كيفية: الترجمة وإعادة تشغيل أمثلة التعليمات البرمجية لطراز كائن التنفيذ التلقائي