Share via


Windows, interface

La collection Windows contient toutes les fenêtres de l'environnement.

Espace de noms :  EnvDTE
Assembly :  EnvDTE (dans EnvDTE.dll)

Syntaxe

'Déclaration
<GuidAttribute("2294311A-B7BC-4789-B365-1C15FF2CD17C")> _
Public Interface Windows _
    Inherits IEnumerable
[GuidAttribute("2294311A-B7BC-4789-B365-1C15FF2CD17C")]
public interface Windows : IEnumerable
[GuidAttribute(L"2294311A-B7BC-4789-B365-1C15FF2CD17C")]
public interface class Windows : IEnumerable
[<GuidAttribute("2294311A-B7BC-4789-B365-1C15FF2CD17C")>]
type Windows =  
    interface 
        interface IEnumerable 
    end
public interface Windows extends IEnumerable

Le type Windows expose les membres suivants.

Propriétés

  Nom Description
Propriété publique Count Obtient une valeur indiquant le nombre d'objets de la collection Windows.
Propriété publique DTE Obtient l'objet d'extensibilité de niveau supérieur.
Propriété publique Parent Obtient l'objet parent immédiat d'une collection Windows.

Début

Méthodes

  Nom Description
Méthode publique CreateLinkedWindowFrame Crée un objet Window et y place deux fenêtres.
Méthode publique CreateToolWindow Crée une fenêtre Outil contenant l'objet Document ou le contrôle ActiveX spécifié.
Méthode publique GetEnumerator Retourne une énumération pour les éléments d'une collection.
Méthode publique Item Retourne un objet Window dans une collection Windows.

Début

Exemples

Sub LinkedWindowsExample()
   Dim Frame As Window
   Dim w1 As Window = DTE.Windows.Item(Constants.vsWindowKindSolutionExplorer)
   Dim w2 As Window = DTE.Windows.Item(Constants.vsWindowKindOutput)
   Dim w3 As Window = DTE.Windows.Item(Constants.vsWindowKindCommandWindow)

   ' Create a linked window frame and dock Solution Explorer 
   ' and the Ouput window together inside it.
   Frame = DTE.Windows.CreateLinkedWindowFrame(w1, w2, vsLinkedWindowType.vsLinkedWindowTypeDocked)
   MsgBox("Total number of windows in the linked window frame: " & Frame.LinkedWindows.Count)

    ' Add another tool window, the Command window, to the frame with 
    ' the other two.
   Frame.LinkedWindows.Add(w3)
   MsgBox("Total number of windows in the linked window frame: " & Frame.LinkedWindows.Count)

   ' Resize the entire linked window frame.
   Frame.Width = 500
   Frame.Height = 600
   MsgBox("Frame height and width changed. Now changing Command window height.")

   ' Resize the height of the Command window.
   Frame.LinkedWindows.Item(3).Height = 800
   MsgBox("Now undocking the Command window from the frame.")

   ' Undock the Command window from the frame.
   Frame.LinkedWindows.Remove(w3)
End Sub

Voir aussi

Référence

EnvDTE, espace de noms