[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.Forms.ListBoxItem.-ctor

ListBoxItem Constructor

ListBoxItem()

Creates an empty item.

Use this constructor to create a ListBoxItem without an initial value, and then assign its content through Value before adding it to Items.

Declaration
public ListBoxItem()
Public Sub New()
Examples
IListBox listBox = worksheet.Controls.AddListBox(20, 20, 120, 80);
ListBoxItem item = new ListBoxItem();
item.Value = "North";
listBox.Items.Add(item);

ListBoxItem(string)

Creates a list box item with the specified value.

This constructor initializes the item by assigning value to Value.

Declaration
public ListBoxItem(string value)
Public Sub New(value As String)
Parameters
Type Name Description
string value

The item value. Can be null.

Examples
IListBox listBox = worksheet.Controls.AddListBox(20, 20, 120, 80);
listBox.Items.Add(new ListBoxItem("North"));