ToolBoxTab2.ListView Özellik
Alır veya gösteren bir değeri ayarlar olup olmadığını öğeleri belirli bir araç sekmesinde görünen liste görünümünde veya simge görünüm biçimi.
Ad alanı: EnvDTE80
Derleme: EnvDTE80 (EnvDTE80.dll içinde)
Sözdizimi
'Bildirim
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)
Özellik Değeri
Tür: System.Boolean
true araç sekme olan liste görünümünde; Aksi halde, false.
Notlar
ListView' nde sekmesi sekmesini temelinde uygulanır ToolBox.Diğer bir deyişle, başka bir simge görünümüne sahipken bir sekme liste görünümü sağlayabilirsiniz.
Liste ve simge görünümleri Windows Gezgini'nde benzerdir.Liste görünümünde, içeriğini araç metin açıklamalarını birbiri ardına, sol tarafında bir simgeyle listelenir.Simge görünümünde her öğe yalnızca bir simgeyle temsil edilir.Fare üzerinde çalışırken simgeyi araç ipucu açıklaması elde edebilirsiniz.
Örnekler
Bu örnek değiştirir ListView Toolbox sekmesinin özelliği.Bu örnek, bir eklenti çalıştırma hakkında daha fazla bilgi için bkz: Nasıl yapılır: derlemek ve Otomasyon nesne modeli kod örneklerini çalıştırmak.
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);
}
}
.NET Framework Güvenliği
- Anında arayanlar için tam güven. Bu üye kısmen güvenilen kodla kullanılamaz. Daha fazla bilgi için bkz. Kısmen güvenilen kod kitaplıklarını kullanma.