Proprietà ToolBoxTab2.ListView

Ottiene o imposta un valore che indica se elementi in un determinato Casella degli strumenti visualizzazione della scheda nel formato di visualizzazione icone o della visualizzazione elenco.

Spazio dei nomi:  EnvDTE80
Assembly:  EnvDTE80 (in EnvDTE80.dll)

Sintassi

'Dichiarazione
Property ListView As Boolean
bool ListView { get; set; }
property bool ListView {
    bool get ();
    void set (bool value);
}
abstract ListView : bool with get, set
function get ListView () : boolean
function set ListView (value : boolean)

Valore proprietà

Tipo: System.Boolean
true se Casella degli strumenti la scheda è in visualizzazione elenco, in caso contrario, false.

Note

ListView viene applicata in base a TAB-da-TAB in ToolBox.Ovvero una scheda può avere visualizzazione elenco mentre un altro utente ha visualizzazione icone.

L'elenco e visualizzazioni iconi sono simili a quelli in Esplora risorse.Nella visualizzazione elenco, il contenuto Casella degli strumenti vengono elencati come descrizioni di testo, una dopo l'altra, con un'icona sul lato sinistro.Nella visualizzazione icone, ogni elemento è rappresentato solo da un'icona.È possibile ottenere una descrizione della descrizione comandi icona utilizzando il mouse su.

Esempi

In questo esempio viene passata ListView proprietà di una scheda della casella degli strumenti.Per ulteriori informazioni su come eseguire questo esempio viene illustrato come componente aggiuntivo, vedere Procedura: compilare ed eseguire gli esempi di codice del modello a oggetti di automazione.

Imports EnvDTE
Imports EnvDTE80
Public Sub OnConnection(ByVal application As Object, _
 ByVal connectMode As ext_ConnectMode, ByVal addInInst As Object, _
 ByRef custom As Array) Implements IDTExtensibility2.OnConnection
    _applicationObject = CType(application, DTE2)
    _addInInstance = CType(addInInst, AddIn)
    ToolBoxListViewExample(_applicationObject)
End Sub
Sub ToolBoxListViewExample(ByVal dte As DTE2)
    Dim tlBox As ToolBox
    Dim tbxTabs As ToolBoxTabs
    Dim tbxTab As ToolBoxTab2
    Dim tbxItem As ToolBoxItem
    ' Before runiing 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 = CType(_applicationObject.Windows.Item _
         (Constants.vsWindowKindToolbox).Object, ToolBox)
        tbxTabs = tlBox.ToolBoxTabs
        ' Select the first ToolBox tab.
        tbxTab = CType(tbxTabs.Item(3), ToolBoxTab2)
        MsgBox(tbxTab.Name)
        tbxTab.Activate()
        tbxItem = tbxTab.ToolBoxItems.Item(1)
        MsgBox("Toolbox item name: " & tbxItem.Name)
        MsgBox("Turning Toolbox to List view...")
        tbxTab.ListView = False
        MsgBox("Turning Toolbox to Icon view...")
        tbxTab.ListView = True
    Catch ex As System.Exception
        MsgBox("ERROR: " & ex.Message)
    End Try
End Sub
using EnvDTE;
using EnvDTE80;
using System.Windows.Forms;
public void OnConnection(object application, 
ext_ConnectMode connectMode, object addInInst, ref Array custom)
{
    _applicationObject = (DTE2)application;
    _addInInstance = (AddIn)addInInst;
    ToolBoxListViewExample(_applicationObject);
}
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);
    }
}

Sicurezza di .NET Framework

Vedere anche

Riferimenti

ToolBoxTab2 Interfaccia

Overload ListView

Spazio dei nomi EnvDTE80