# FarPoint.Win.Spread.NamedStyleCollection.Add

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="FarPoint_Win_Spread_NamedStyleCollection_Add_" data-uid="FarPoint.Win.Spread.NamedStyleCollection.Add*">Add Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="FarPoint_Win_Spread_NamedStyleCollection_Add_" data-uid="FarPoint.Win.Spread.NamedStyleCollection.Add*"></a>
<h4 id="FarPoint_Win_Spread_NamedStyleCollection_Add_FarPoint_Win_Spread_NamedStyle_" data-uid="FarPoint.Win.Spread.NamedStyleCollection.Add(FarPoint.Win.Spread.NamedStyle)">Add(NamedStyle)</h4>
<div class="markdown level1 summary"><p>Adds a style (NamedStyle object) to the collection.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public virtual int Add(NamedStyle style)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Overridable Function Add(style As NamedStyle) 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="FarPoint.Win.Spread.NamedStyle.html">NamedStyle</a></td>
      <td><span class="parametername">style</span></td>
      <td><p>Name of the style to add</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 index of style in collection.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Condition</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.argumentnullexception">ArgumentNullException</a></td>
      <td><p>No style specified or specified style is null</p>
</td>
    </tr>
  </tbody>
</table>


<a id="FarPoint_Win_Spread_NamedStyleCollection_Add_" data-uid="FarPoint.Win.Spread.NamedStyleCollection.Add*"></a>
<h4 id="FarPoint_Win_Spread_NamedStyleCollection_Add_System_String_System_String_" data-uid="FarPoint.Win.Spread.NamedStyleCollection.Add(System.String,System.String)">Add(string, string)</h4>
<div class="markdown level1 summary"><p>Adds a style (NamedStyle object) to the collection as a child
of the specified parent.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public virtual NamedStyle Add(string name, string parentName)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Overridable Function Add(name As String, parentName As String) As NamedStyle</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 style to add</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">parentName</span></td>
      <td><p>Parent style of the style to add</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="FarPoint.Win.Spread.NamedStyle.html">NamedStyle</a></td>
      <td><p>An NamedStyle in collection.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
