Export (0) Print
Expand All
Expand Minimize

Select Method (General Extensibility)

Visual Studio .NET 2003

Causes this item to become active in the interactive development environment (IDE).

[Visual Basic .NET]
Public Sub Select() 
[Visual Basic 6]
Sub Select() 
HRESULT __stdcall Select();
public void Select();
[JScript .NET]
public function Select()


  • For the TaskItem object, makes this item the currently selected task. If the Displayed property is False, however, then Select fails.
  • For the ToolBoxItem object, makes this item the currently selected item in the tool box.


Sub SelectExample()
   Dim objToolbox As ToolBox
   Dim colTbxTabs As ToolBoxTabs
   Dim objTab As ToolBoxTab
   Dim colTbxItems As ToolBoxItems
   Dim objTbxItem As ToolBoxItem

   ' Create references to the IDE's ToolBox object and ToolBoxTabs 
   ' collection.
   objToolbox = DTE.Windows.Item(Constants.vsWindowKindToolbox).Object
   colTbxTabs = objToolbox.ToolBoxTabs
   objTab = colTbxTabs.Item(1)
   colTbxItems = objTab.ToolBoxItems

   ' Add a new tab to the ToolBox.
   objTab = colTbxTabs.Add("Sample ToolBoxTab")

   ' Add a couple of new ToolboxItem objects to the new tab we just added.
   objTbxItem = objTab.ToolBoxItems.Add("Text Item", "Hello world")
   objTbxItem = objTab.ToolBoxItems.Add("HTML Item", "Hello world", vsToolBoxItemFormat.vsToolBoxItemFormatHTML)

   ' Select the third item on the newly-created tab in the Toolbox and 
   ' delete it.
   If (MsgBox("Delete the selected ToolBox item?", vbYesNo) = vbYes) Then
   End If
End Sub

See Also

Applies To: TaskItem Object | ToolBoxItem Object

© 2014 Microsoft