Condividi tramite


Proprietà Document.ActiveWindow

Ottiene la finestra attualmente attiva, o la finestra in primo piano se non altri sono attivi.Restituisce Nothing se non sono disponibili finestre aperte.

Spazio dei nomi:  EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)

Sintassi

'Dichiarazione
ReadOnly Property ActiveWindow As Window
Window ActiveWindow { get; }
property Window^ ActiveWindow {
    Window^ get ();
}
abstract ActiveWindow : Window
function get ActiveWindow () : Window

Valore proprietà

Tipo: EnvDTE.Window
In Window oggetto.

Note

ActiveWindow restituisce la finestra attiva del documento.È possibile impostare la barra del titolo delle finestre degli strumenti.Se si tenta di impostare la barra del titolo su altri tipi di finestre, ad esempio le finestre di documento, viene generato l'errore, “errore non specificato.„

Esempi

public void WindowExample(DTE2 dte)
{  // Before running, create a text file named 
   // "TextFile1.txt", include it in your solution,
   // and select some text.
   Window win;
   Document doc;
   if (dte.Documents.Count > 0)
   {
      doc = dte.Documents.Item("TextFile1.txt");
      win = doc.ActiveWindow;
      // Show the name of the project that contains this window and document.
      MessageBox.Show(win.Project.Name);
   }
}

Sicurezza di .NET Framework

Vedere anche

Riferimenti

Document Interfaccia

Spazio dei nomi EnvDTE