# FarPoint.Win.Spread.CustomIconContainer.AddIcon

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="FarPoint_Win_Spread_CustomIconContainer_AddIcon_" data-uid="FarPoint.Win.Spread.CustomIconContainer.AddIcon*">AddIcon Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="FarPoint_Win_Spread_CustomIconContainer_AddIcon_" data-uid="FarPoint.Win.Spread.CustomIconContainer.AddIcon*"></a>
<h4 id="FarPoint_Win_Spread_CustomIconContainer_AddIcon_System_String_System_Drawing_Icon_" data-uid="FarPoint.Win.Spread.CustomIconContainer.AddIcon(System.String,System.Drawing.Icon)">AddIcon(string, Icon)</h4>
<div class="markdown level1 summary"><p>Adds an icon object into a container.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public int AddIcon(string name, Icon icon)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function AddIcon(name As String, icon As Icon) As Integer</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">name</span></td>
      <td><p>Name of the icon object</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.icon">Icon</a></td>
      <td><span class="parametername">icon</span></td>
      <td><p>The icon object</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><p>An int32 value that specifies the index of the object in the container. Returns -1 if there is an icon with the same name already in the container; in this case, the new icon object is not added.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
