Export (0) Print
Expand All
Cut
Run
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() 
[C++]
HRESULT __stdcall Select();
[C#]
public void Select();
[JScript .NET]
public function Select()

Remarks

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

Examples

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.
   colTbxTabs.Item(1).Activate()
   colTbxItems.Item(3).Select()
   If (MsgBox("Delete the selected ToolBox item?", vbYesNo) = vbYes) Then
      colTbxItems.SelectedItem.Delete()
   End If
End Sub

See Also

Applies To: TaskItem Object | ToolBoxItem Object

Show:
© 2014 Microsoft