Description
The Shape class allows the appearance and behavior of drawing object to be manipulated. On its own, Shape
represents a simple auto shape, such as a line, rectangle, or oval. A shape may also represent the display area of a Comment or the size, position, and formatting of a Picture.
C#
vb.net
Remarks
Once a Shape
is created with a particular ShapeType, the type may not be changed. Instead, delete the shape and create a new one with the appropriate type.
To create a Shape
object, call Shapes.CreateShape.
Properties
Name |
Description |
---|---|
Sets or returns the shape's fill color. The color may be either a custom color or a palette color. | |
Sets or returns the fill transparency the shape as a real number value between 0 (opaque) and 1 (transparent). | |
Sets or returns whether the shape will be automatically sized to fit the text. | |
Sets or returns the height of the Shape. | |
Sets or returns the horizontal alignment of text within the shape. | |
Sets or returns the Shape 's line color. | |
Sets or returns whether the aspect ratio of the shape will be locked in Excel. This setting has no effect within ExcelWriter. | |
Returns the name associated with this shape. | |
Sets or returns the ObjectPositioning value that determines the shape's resize and reposition behavior when the cells in the worksheet are changed. | |
Sets or returns the Shape's position in the worksheet. This property determines the location of the shape's upper left corner. | |
Sets or returns the rotation angle of the shape. | |
Sets or returns the text displayed within the shape. | |
Returns the Shape object's type. This property may not be changed. | |
Sets or returns the vertical alignment of text within the shape. | |
Sets or returns the width of the Shape. |
Properties
Methods
Name |
Description |
---|---|
Clears all rich text formatting within the shape. The font of the shape will be set to the normal font of the workbook. | |
Returns a CharacterRun object representing a range of characters within the comment text. Use this to set the font on specified characters within the text. | |
Returns a CharacterRun object representing a range of characters within the comment text. Use this to set the font on specified characters within the text. | |
Sets the fill color for the shape to be the specified custom RGB value, and returns the generated Color. This method allows a shape to have a color not defined in the worksheet's Palette. | |
Sets the line color for the shape to be the specified custom RGB value, and returns the generated Color. This method allows a shape to have a line color not defined in the worksheet's Palette. |