Export (0) Print
Expand All

ToolBoxTab Object

Visual Studio .NET 2003

Represents a tab in the ToolBox, along with any objects the tab contains.







[Visual Basic .NET]
Public Interface ToolBoxTab
    Inherits IDispatch
[Visual Basic 6]
Class ToolBoxTab
interface ToolBoxTab : IDispatch
public interface ToolBoxTab : IDispatch
[JScript .NET]
public interface ToolBoxTab extends IDispatch


Namespace: EnvDTE

File: dte.olb


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

   ' Create an object reference to the IDE's ToolBox object.    
   objToolbox = DTE.Windows.Item(Constants.vsWindowKindToolbox).Object
   colTbxTabs = objToolbox.ToolBoxTabs

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

   ' Use the ToolboxItems collection to access all the items under a 
   ' ToolBoxTab.
   colTbxItems = objTab.ToolBoxItems

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

See Also

Properties, Events, and Methods | ToolBox Object | ToolBoxItem Object | ToolBoxTab Object | ToolBoxTabs Collection

© 2014 Microsoft