次の方法で共有


LinkedWindows.Item メソッド

更新 : 2007 年 11 月

LinkedWindows コレクション内の Window オブジェクトを返します。

名前空間 :  EnvDTE
アセンブリ :  EnvDTE (EnvDTE.dll 内)

構文

'宣言
Function Item ( _
    index As Object _
) As Window
'使用
Dim instance As LinkedWindows
Dim index As Object
Dim returnValue As Window

returnValue = instance(index)
Window Item(
    Object index
)
Window^ Item(
    [InAttribute] Object^ index
)
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

アクセス許可

  • 直前の呼び出し元に対する完全な信頼。このメンバは、部分的に信頼されているコードから使用することはできません。詳細については、「部分信頼コードからのライブラリの使用」を参照してください。

参照

参照

LinkedWindows インターフェイス

LinkedWindows メンバ

EnvDTE 名前空間

その他の技術情報

方法 : オートメーション オブジェクト モデルのコード例をコンパイルおよび実行する