Spread Windows Forms 9.0 Product Documentation
AddShape(PSShape,Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32,Boolean) Method
Example 


Shape to add
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Syntax
'Declaration
 
Public Overloads Overridable Function AddShape( _
   ByVal shape As PSShape, _
   ByVal fromRow As Integer, _
   ByVal fromColumn As Integer, _
   ByVal fromRowPixelOffset As Integer, _
   ByVal fromColumnPixelOffset As Integer, _
   ByVal toRow As Integer, _
   ByVal toColumn As Integer, _
   ByVal toRowPixelOffset As Integer, _
   ByVal toColumnPixelOffset As Integer, _
   ByVal attachedToCell As Boolean _
) As Integer
'Usage
 
Dim instance As SheetView
Dim shape As PSShape
Dim fromRow As Integer
Dim fromColumn As Integer
Dim fromRowPixelOffset As Integer
Dim fromColumnPixelOffset As Integer
Dim toRow As Integer
Dim toColumn As Integer
Dim toRowPixelOffset As Integer
Dim toColumnPixelOffset As Integer
Dim attachedToCell As Boolean
Dim value As Integer
 
value = instance.AddShape(shape, fromRow, fromColumn, fromRowPixelOffset, fromColumnPixelOffset, toRow, toColumn, toRowPixelOffset, toColumnPixelOffset, attachedToCell)
public virtual int AddShape( 
   PSShape shape,
   int fromRow,
   int fromColumn,
   int fromRowPixelOffset,
   int fromColumnPixelOffset,
   int toRow,
   int toColumn,
   int toRowPixelOffset,
   int toColumnPixelOffset,
   bool attachedToCell
)

Parameters

shape
Shape to add
fromRow
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.
fromColumn
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.
fromRowPixelOffset
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.
fromColumnPixelOffset
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.
toRow
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.
toColumn
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.
toRowPixelOffset
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.
toColumnPixelOffset
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.
attachedToCell
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.
Example
This example adds a shape.
FarPoint.Win.Spread.DrawingSpace.ArrowShape arrow = new FarPoint.Win.Spread.DrawingSpace.ArrowShape();
arrow.Parent = fpSpread1;
fpSpread1.ActiveSheet.AddShape(arrow, 2, 2, 3, 3, 4, 4, 6, 6, false);
Dim arrow As New FarPoint.Win.Spread.DrawingSpace.ArrowShape()
arrow.Parent = FpSpread1
FpSpread1.ActiveSheet.AddShape(arrow, 2, 2, 3, 3, 4, 4, 6, 6, False)
Requirements

Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows Server 2012 R2, Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8, Windows 8.1, Windows 10

See Also

Reference

SheetView Class
SheetView Members
Overload List

 

 


Copyright © GrapeCity, inc. All rights reserved.