Document.ActiveWindow (Propiedad)

Actualización: noviembre 2007

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

ReadOnly Property ActiveWindow As Window

Dim instance As Document
Dim value As Window

value = instance.ActiveWindow
Window ActiveWindow { get; }
property Window^ ActiveWindow {
    Window^ get ();
}
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 el título en ventanas de tipo Tool. Si intenta establecer el título 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);
   }
}

Permisos

Vea también

Referencia

Document (Interfaz)

Document (Miembros)

EnvDTE (Espacio de nombres)