Compartir a través de


Document.ActiveWindow (Propiedad)

Obtiene la ventana activa actual, o la ventana de nivel superior si no hay otras ventanas activas. Devuelve Nothing si no hay ventanas abiertas.

Espacio de nombres:  EnvDTE
Ensamblado:  EnvDTE (en EnvDTE.dll)

Sintaxis

'Declaración
ReadOnly Property ActiveWindow As Window
    Get
Window ActiveWindow { get; }
property Window^ ActiveWindow {
    Window^ get ();
}
abstract ActiveWindow : Window
function get ActiveWindow () : Window

Valor de propiedad

Tipo: EnvDTE.Window
Un objeto Window.

Comentarios

ActiveWindow devuelve la ventana activa del documento. Sólo se puede establecer la leyenda en ventanas de tipo Tool. Si intenta establecer la leyenda en otro tipo de ventana, como ventanas de tipo Document, obtendrá un "Error no especificado".

Ejemplos

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);
   }
}

Seguridad de .NET Framework

Vea también

Referencia

Document Interfaz

EnvDTE (Espacio de nombres)