ListBoxItem 類別

定義

警告

此 API 現已淘汰。

表示 ListBoxComboBox 控制項中的項目,該控制項位於已從 Visual Basic 6.0 升級的應用程式中。Represents an item in a ListBox or ComboBox control in an application that was upgraded from Visual Basic 6.0.

public ref class ListBoxItem
[System.Obsolete("Microsoft.VisualBasic.Compatibility.* classes are obsolete and supported within 32 bit processes only. https://go.microsoft.com/fwlink/?linkid=160862")]
public class ListBoxItem
type ListBoxItem = class
Public Class ListBoxItem
繼承
ListBoxItem
屬性

備註

在 Visual Basic 6.0 中,ListBoxComboBox 控制項會使用 List 屬性來儲存清單專案,並使用 ItemData 屬性來選擇性地儲存與每個清單專案相關聯的 IntegerIn Visual Basic 6.0, the ListBox and ComboBox controls use a List property to store list items and an ItemData property to optionally store an Integer associated with each list item. 在 Visual Basic 中,ListBoxComboBox 控制項會使用 Items 屬性來儲存清單專案,而不再支援 ItemData 屬性。In Visual Basic, the ListBox and ComboBox controls use the Items property to store list items, and the ItemData property is no longer supported.

當 Visual Basic 6.0 應用程式升級為 Visual Basic 時,升級工具會為 ListBoxComboBox 控制項中的每個專案建立 ListBoxItem 類別。When a Visual Basic 6.0 application is upgraded to Visual Basic, the upgrade tools create a ListBoxItem class for each item in a ListBox or ComboBox control. 然後,SetItemDataGetItemData 函式可以用來啟用任何參考 ItemData 屬性的程式碼。The SetItemData and GetItemData functions can then be used to enable any code that references the ItemData property.

注意

Microsoft.VisualBasic.Compatibility.VB6 命名空間中的函式和物件都是供這些工具使用,以便從 Visual Basic 6.0 升級至 Visual Basic 2008。Functions and objects in the Microsoft.VisualBasic.Compatibility.VB6 namespace are provided for use by the tools for upgrading from Visual Basic 6.0 to Visual Basic 2008. 在大多數情況下,這些函式和物件會複製在 .NET Framework 其他命名空間中可以找到的功能。In most cases, these functions and objects duplicate functionality that you can find in other namespaces in the .NET Framework. 只有當 Visual Basic 6.0 程式碼模型與 .NET Framework 實作有顯著差異時,才會需要這些函式和物件。They are necessary only when the Visual Basic 6.0 code model differs significantly from the .NET Framework implementation.

建構函式

ListBoxItem(String)

初始化 ListBoxItem 類別的執行個體。Initializes an instance of the ListBoxItem class.

ListBoxItem(String, Int32)

初始化 ListBoxItem 類別的執行個體。Initializes an instance of the ListBoxItem class.

欄位

ItemData

儲存 ListBoxComboBox 控制項中項目的 ItemData 值,該控制項位於已從 Visual Basic 6.0 升級的應用程式中。Stores the ItemData value for an item in a ListBox or ComboBox control in an application that was upgraded from Visual Basic 6.0.

ItemString

儲存 ListBoxComboBox 控制項中項目的 List 值,該控制項位於已從 Visual Basic 6.0 升級的應用程式中。Stores the List value for an item in a ListBox or ComboBox control in an application that was upgraded from Visual Basic 6.0.

方法

Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(繼承來源 Object)
GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(繼承來源 Object)
ToString()

ListBoxItem 轉換成 StringConverts a ListBoxItem to a String.

適用於