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

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Documents_Excel_Forms_ListBoxItem__ctor_" data-uid="GrapeCity.Documents.Excel.Forms.ListBoxItem.#ctor*">ListBoxItem Constructor
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Documents_Excel_Forms_ListBoxItem__ctor_" data-uid="GrapeCity.Documents.Excel.Forms.ListBoxItem.#ctor*"></a>
<h4 id="GrapeCity_Documents_Excel_Forms_ListBoxItem__ctor" data-uid="GrapeCity.Documents.Excel.Forms.ListBoxItem.#ctor">ListBoxItem()</h4>
<div class="markdown level1 summary"><p>Creates an empty item.</p>
<p>
Use this constructor to create a <code>ListBoxItem</code> without an initial value,
and then assign its content through <a class="xref" href="GrapeCity.Documents.Excel.Forms.SelectorItem.Value.html#GrapeCity_Documents_Excel_Forms_SelectorItem_Value">Value</a> before adding it
to <a class="xref" href="GrapeCity.Documents.Excel.Forms.ISelector-1.Items.html#GrapeCity_Documents_Excel_Forms_ISelector_1_Items">Items</a>.
</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public ListBoxItem()</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub New()</code></pre>
</div>
<h5 id="GrapeCity_Documents_Excel_Forms_ListBoxItem__ctor_examples">Examples</h5>
<pre><code class="lang-csharp">IListBox listBox = worksheet.Controls.AddListBox(20, 20, 120, 80);
ListBoxItem item = new ListBoxItem();
item.Value = "North";
listBox.Items.Add(item);</code></pre>



<a id="GrapeCity_Documents_Excel_Forms_ListBoxItem__ctor_" data-uid="GrapeCity.Documents.Excel.Forms.ListBoxItem.#ctor*"></a>
<h4 id="GrapeCity_Documents_Excel_Forms_ListBoxItem__ctor_System_String_" data-uid="GrapeCity.Documents.Excel.Forms.ListBoxItem.#ctor(System.String)">ListBoxItem(string)</h4>
<div class="markdown level1 summary"><p>Creates a list box item with the specified value.</p>
<p>This constructor initializes the item by assigning <code>value</code> to <a class="xref" href="GrapeCity.Documents.Excel.Forms.SelectorItem.Value.html#GrapeCity_Documents_Excel_Forms_SelectorItem_Value">Value</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public ListBoxItem(string value)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub New(value As String)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">value</span></td>
      <td><p>The item value. Can be <code><a href="https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null">null</a></code>.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="GrapeCity_Documents_Excel_Forms_ListBoxItem__ctor_System_String__examples">Examples</h5>
<pre><code class="lang-csharp">IListBox listBox = worksheet.Controls.AddListBox(20, 20, 120, 80);
listBox.Items.Add(new ListBoxItem("North"));</code></pre>

</div>
