共用方式為


LinkedWindows.Item 方法

傳回在 LinkedWindows 集合中的 Window 物件。

命名空間:  EnvDTE
組件:  EnvDTE (在 EnvDTE.dll 中)

語法

'宣告
Function Item ( _
    index As Object _
) As Window
Window Item(
    Object index
)
Window^ Item(
    [InAttribute] Object^ index
)
abstract Item : 
        index:Object -> Window 
function Item(
    index : Object
) : Window

參數

傳回值

型別:EnvDTE.Window
Window 物件。

備註

傳遞到 Index 的值,可為代表在 LinkedWindows 集合中的 Window 物件索引之整數值,或是集合中的 Window 物件名稱。

如果集合無法找到對應於索引值的物件,Item 方法就會擲回 ArgumentException 例外狀況。

範例

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 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

.NET Framework 安全性

請參閱

參考

LinkedWindows 介面

EnvDTE 命名空間

其他資源

HOW TO:編譯和執行 Automation 物件模型程式碼範例