Compartilhar via


Propriedade Document.ActiveWindow

Obtém a janela ativa no momento ou a janela superior se não há outras pessoas estiverem ativas. Retorna Nothing se não há janelas estiverem abertas.

Namespace:  EnvDTE
Assembly:  EnvDTE (em EnvDTE.dll)

Sintaxe

'Declaração
ReadOnly Property ActiveWindow As Window
Window ActiveWindow { get; }
property Window^ ActiveWindow {
    Window^ get ();
}
abstract ActiveWindow : Window with get
function get ActiveWindow () : Window

Valor de propriedade

Tipo: EnvDTE.Window
A Window object.

Comentários

ActiveWindowRetorna a janela ativa do documento. Você pode definir a legenda somente em janelas de ferramentas. Se você tentar definir a legenda em outros tipos de janela, como janelas de documento, você obtém o erro, "Erro não especificado".

Exemplos

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

Segurança do .NET Framework

Consulte também

Referência

Document Interface

Namespace EnvDTE