# FarPoint.Win.Spread.SheetView.AddShape

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="FarPoint_Win_Spread_SheetView_AddShape_" data-uid="FarPoint.Win.Spread.SheetView.AddShape*">AddShape Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="FarPoint_Win_Spread_SheetView_AddShape_" data-uid="FarPoint.Win.Spread.SheetView.AddShape*"></a>
<h4 id="FarPoint_Win_Spread_SheetView_AddShape_FarPoint_Win_Spread_DrawingSpace_PSShape_" data-uid="FarPoint.Win.Spread.SheetView.AddShape(FarPoint.Win.Spread.DrawingSpace.PSShape)">AddShape(PSShape)</h4>
<div class="markdown level1 summary"><p>Adds a shape to the drawing container for the sheet.</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 AddShape(PSShape shape)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Overridable Function AddShape(shape As PSShape) 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.DrawingSpace.PSShape.html">PSShape</a></td>
      <td><span class="parametername">shape</span></td>
      <td><p>Shape 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>The new created instance of the shape.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="FarPoint_Win_Spread_SheetView_AddShape_" data-uid="FarPoint.Win.Spread.SheetView.AddShape*"></a>
<h4 id="FarPoint_Win_Spread_SheetView_AddShape_FarPoint_Win_Spread_DrawingSpace_PSShape_System_Int32_System_Int32_" data-uid="FarPoint.Win.Spread.SheetView.AddShape(FarPoint.Win.Spread.DrawingSpace.PSShape,System.Int32,System.Int32)">AddShape(PSShape, int, int)</h4>
<div class="markdown level1 summary"><p>Adds a shape to the drawing container for the sheet at the specified row and column.</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 AddShape(PSShape shape, int row, int column)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Overridable Function AddShape(shape As PSShape, row As Integer, column As Integer) 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.DrawingSpace.PSShape.html">PSShape</a></td>
      <td><span class="parametername">shape</span></td>
      <td><p>Shape to add</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">row</span></td>
      <td><p>Row index at which to add shape</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">column</span></td>
      <td><p>Column index at which to add shape</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>The new created instance of the shape.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="FarPoint_Win_Spread_SheetView_AddShape_" data-uid="FarPoint.Win.Spread.SheetView.AddShape*"></a>
<h4 id="FarPoint_Win_Spread_SheetView_AddShape_FarPoint_Win_Spread_DrawingSpace_PSShape_System_Int32_System_Int32_System_Int32_System_Int32_System_Boolean_" data-uid="FarPoint.Win.Spread.SheetView.AddShape(FarPoint.Win.Spread.DrawingSpace.PSShape,System.Int32,System.Int32,System.Int32,System.Int32,System.Boolean)">AddShape(PSShape, int, int, int, int, bool)</h4>
<div class="markdown level1 summary"><p>Adds a shape to the drawing container for the sheet at the specified row and column with the offset from the top-left of the cell.</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 AddShape(PSShape shape, int row, int column, int rowPixelOffset, int columnPixelOffset, bool attachedToCell)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Overridable Function AddShape(shape As PSShape, row As Integer, column As Integer, rowPixelOffset As Integer, columnPixelOffset As Integer, attachedToCell As Boolean) 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.DrawingSpace.PSShape.html">PSShape</a></td>
      <td><span class="parametername">shape</span></td>
      <td><p>Shape to add</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">row</span></td>
      <td><p>Row index at which to add the shape. The row parameter must be greater than or equal to 0 and less than the sheetview's row count.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">column</span></td>
      <td><p>Column index at which to add the shape. The column parameter must be greater than or equal to 0 and less than the sheetview's column count.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">rowPixelOffset</span></td>
      <td><p>The distance between the top boundary of the shape and the top of the specified row. The rowPixelOffset parameter must be greater than or equal to 0.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">columnPixelOffset</span></td>
      <td><p>The distance between the left boundary of the shape and the left edge of the specified column. The columnPixelOffset parameter must be greater than or equal to 0.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">attachedToCell</span></td>
      <td><p>Indicates whether the top-left edge of the shape stays within the cell specified by the parameters.
If attachedToCell is false, when the specified rowPixelOffset or columnPixelOffset is greater than or equal to the specified row or column's height or width,
the top-left vertex of the shape's boundary moves to the next visible row or column so that the distance between the top-left vertex and the top-left of the specified row or column is equal to rowPixelOffset or columnPixelOffset.</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>The new created instance of the shape.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="FarPoint_Win_Spread_SheetView_AddShape_" data-uid="FarPoint.Win.Spread.SheetView.AddShape*"></a>
<h4 id="FarPoint_Win_Spread_SheetView_AddShape_FarPoint_Win_Spread_DrawingSpace_PSShape_System_Int32_System_Int32_System_Int32_System_Int32_System_Int32_System_Int32_System_Int32_System_Int32_System_Boolean_" data-uid="FarPoint.Win.Spread.SheetView.AddShape(FarPoint.Win.Spread.DrawingSpace.PSShape,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Boolean)">AddShape(PSShape, int, int, int, int, int, int, int, int, bool)</h4>
<div class="markdown level1 summary"><p>Adds a shape to the drawing container for the sheet at the specified row and column with the top-left offset with the top-left and bottom-right cell.</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 AddShape(PSShape shape, int fromRow, int fromColumn, int fromRowPixelOffset, int fromColumnPixelOffset, int toRow, int toColumn, int toRowPixelOffset, int toColumnPixelOffset, bool attachedToCell)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Overridable Function AddShape(shape As PSShape, fromRow As Integer, fromColumn As Integer, fromRowPixelOffset As Integer, fromColumnPixelOffset As Integer, toRow As Integer, toColumn As Integer, toRowPixelOffset As Integer, toColumnPixelOffset As Integer, attachedToCell As Boolean) 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.DrawingSpace.PSShape.html">PSShape</a></td>
      <td><span class="parametername">shape</span></td>
      <td><p>Shape to add</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">fromRow</span></td>
      <td><p>Row index at which to add the shape. The fromRow parameter must be greater than or equal to 0 and less than the sheetview's row count.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">fromColumn</span></td>
      <td><p>Column index at which to add the shape. The fromColumn parameter must be greater than or equal to 0 and less than the sheetview's column count.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">fromRowPixelOffset</span></td>
      <td><p>The distance between the top boundary of the shape and the top of the specified row. The fromRowPixelOffset parameter must be greater than or equal to 0.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">fromColumnPixelOffset</span></td>
      <td><p>The distance between the left boundary of the shape and the left of the specified column. The fromColumnPixelOffset parameter must be greater than or equal to 0.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">toRow</span></td>
      <td><p>Row index that specifies the bottom boundary of the shape. The toRow parameter must be greater than or equal to fromRow and less than the sheetview's row count.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">toColumn</span></td>
      <td><p>Column index that specifies the right boundary of the shape. The toColumn parameter must be greater than or equal to fromColumn and less than the sheetview's column count.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">toRowPixelOffset</span></td>
      <td><p>The distance between the bottom boundary of the shape and the top of toRow.
The toRowPixelOffset parameter must be greater than or equal to 0. If toRow is equal to fromRow, toRowPixelOffset must be greater than fromRowPixelOffset.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">toColumnPixelOffset</span></td>
      <td><p>The distance between the right boundary of the shape and the left of toColumn.
The toColumnPixelOffset parameter must be greater than or equal to 0. If toColumn is equal to fromColumn, toColumnPixelOffset must be greater than fromColumnPixelOffset.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">attachedToCell</span></td>
      <td><p>Indicates whether the top-left edge of the shape must stay within the cell specified by the fromRow and fromColumn parameters
and whether the bottom-right edge of the shape must stay within the cell specified by the toRow and toColumn parameters.
If attachedToCell is false, when fromRowPixelOffset, fromColumnPixelOffset, toRowPixelOffset, or toColumnPixelOffset is greater than or equal to the toRow, toColumn, fromRow, or fromColumn's height or width,
the top-left or bottom-right vertex of the shape boundary moves to the next row or column. This ensures that
the distance between the top-left or bottom-right vertex and the top, left, bottom, or right of the specified row or column is equal to fromRowPixelOffset, fromColumnPixelOffset, toRowPixelOffset, or toColumnPixelOffset.</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>The new created instance of the shape.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
