ToolBoxTab2.ListView Property

 

Gets or sets a value indicating whether items in a particular ToolBox tab display in List view or Icon view format.

Namespace:   EnvDTE80
Assembly:  EnvDTE80 (in EnvDTE80.dll)

bool ListView { get; set; }

Property Value

Type: System.Boolean

true if the ToolBox tab is in List view; otherwise, false.

ListView applies on a tab-by-tab basis in the ToolBox. That is, one tab can have List view while another has Icon view.

The List and Icon views are similar to those in Windows Explorer. In List view, the contents of the Toolbox are listed as text descriptions, one after another, with an icon on the left side. In Icon view, each item is represented only by an icon. You can get a ToolTip description of the icon by rolling the mouse over it.

This example toggles the ListView property of a Toolbox tab.

Imports EnvDTE
Imports EnvDTE80
using EnvDTE;
using EnvDTE80;
using System.Windows.Forms;
public void ToolBoxListViewExample(DTE2 dte)
{
    ToolBox tlBox;
    ToolBoxTabs tbxTabs;
    ToolBoxTab2 tbxTab;
    ToolBoxItem tbxItem;
    // Before running this example, open a Windows Form project
    // and select Toolbox from the View menu.
    try
    {
        //Create an object reference to the IDE's ToolBox object and
        // its tabs.
        tlBox = (ToolBox)_applicationObject.Windows.Item
(Constants.vsWindowKindToolbox).Object;
        tbxTabs = tlBox.ToolBoxTabs;
        // Select the first Toolbox tab.
        tbxTab = (ToolBoxTab2)tbxTabs.Item(3);
        MessageBox.Show(tbxTab.Name);
        tbxItem = tbxTab.ToolBoxItems.Item(1);
        MessageBox.Show("Toolbox item name: " + tbxItem.Name);
        MessageBox.Show("Turning Toolbox to List view...");
        tbxTab.ListView = false;
        MessageBox.Show("Turning Toolbox to Icon view...");
        tbxTab.ListView = true;
    }
    catch (Exception ex)
    {
        MessageBox.Show("ERROR: " + ex.Message);
    }
}
Return to top
Show: