Class ShapeTextAlignment

Class ShapeTextAlignment

Namespace: Aspose.Cells.Drawing.Texts
Assembly: Aspose.Cells.dll (25.2.0)

Represents the setting of shape’s text alignment;

public class ShapeTextAlignment

Inheritance

objectShapeTextAlignment

Inherited Members

object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Examples

csharp
[C#]
//Instantiating a Workbook object
Workbook workbook = new Workbook();
Shape shape = workbook.Worksheets[0].Shapes.AddRectangle(1, 0, 1, 0, 50, 100);
Aspose.Cells.Drawing.Texts.ShapeTextAlignment shapeTextAlignment = shape.TextBody.TextAlignment;

//do your business

Properties

AutoSize

Indicates if size of shape is adjusted automatically according to its content.

public bool AutoSize { get; set; }

Property Value

bool

Examples

csharp
[C#]
shapeTextAlignment.AutoSize = false;

BottomMarginPt

Returns the bottom margin in unit of Points

public double BottomMarginPt { get; set; }

Property Value

double

Examples

csharp
[C#]
shapeTextAlignment.BottomMarginPt = 2.0d;

IsAutoMargin

Indicates whether the margin of the text frame is automatic.

public bool IsAutoMargin { get; set; }

Property Value

bool

Examples

csharp
[C#]
shapeTextAlignment.IsAutoMargin = true;

IsLockedText

Indicates whether the shape is locked when worksheet is protected.

public bool IsLockedText { get; set; }

Property Value

bool

Remarks

Only works when worksheet is protected.

IsTextWrapped

Gets or sets the text wrapped type of the shape which contains text.

public bool IsTextWrapped { get; set; }

Property Value

bool

Examples

csharp
[C#]
shapeTextAlignment.IsTextWrapped = true;

LeftMarginPt

Returns the left margin in unit of Points

public double LeftMarginPt { get; set; }

Property Value

double

Examples

csharp
[C#]
shapeTextAlignment.LeftMarginPt = 2.0d;

NumberOfColumns

Gets and sets the number of columns of text in the bounding rectangle.

public int NumberOfColumns { get; set; }

Property Value

int

RightMarginPt

Returns the right margin in unit of Points

public double RightMarginPt { get; set; }

Property Value

double

Examples

csharp
[C#]
shapeTextAlignment.RightMarginPt = 2.0d;

RotateTextWithShape

Indicates whether rotating text with shape.

public bool RotateTextWithShape { get; set; }

Property Value

bool

Examples

csharp
[C#]
shapeTextAlignment.RotateTextWithShape = true;

RotationAngle

Gets and sets the rotation of the shape.

public double RotationAngle { get; set; }

Property Value

double

Examples

csharp
[C#]
shapeTextAlignment.RotationAngle = 90;

TextHorizontalOverflow

Gets and sets the text horizontal overflow type of the text box.

public TextOverflowType TextHorizontalOverflow { get; set; }

Property Value

TextOverflowType

Examples

csharp
[C#]
shapeTextAlignment.TextHorizontalOverflow = TextOverflowType.Clip;

TextShapeType

Gets and set the transform type of text.

public AutoShapeType TextShapeType { get; set; }

Property Value

AutoShapeType

Examples

csharp
[C#]
//Usually do not modify this value unless you know exactly what the modification will result in
shapeTextAlignment.TextShapeType = AutoShapeType.TextBox;

TextVerticalOverflow

Gets and sets the text vertical overflow type of the text box.

public TextOverflowType TextVerticalOverflow { get; set; }

Property Value

TextOverflowType

Examples

csharp
[C#]
shapeTextAlignment.TextVerticalOverflow = TextOverflowType.Clip;

TextVerticalType

Gets and sets the text direction.

public TextVerticalType TextVerticalType { get; set; }

Property Value

TextVerticalType

Examples

csharp
[C#]
shapeTextAlignment.TextVerticalType = Aspose.Cells.Drawing.Texts.TextVerticalType.Horizontal;

TopMarginPt

Returns the top margin in unit of Points

public double TopMarginPt { get; set; }

Property Value

double

Examples

csharp
[C#]
shapeTextAlignment.TopMarginPt = 2.0d;

Methods

Equals(object)

Determines whether this instance has the same value as another specified Aspose.Cells.Drawing.Texts.ShapeTextAlignment object.

public override bool Equals(object obj)

Parameters

obj object

The Aspose.Cells.Drawing.Texts.ShapeTextAlignment object to compare with this instance.

Returns

bool

true if the value of the obj parameter is the same as the value of this instance; otherwise, false. If obj is null, this method returns false.

Examples

csharp
[C#]
//You have to make sure that the index value in this line of code exists
Aspose.Cells.Drawing.Texts.ShapeTextAlignment obj = workbook.Worksheets[0].Shapes[0].TextBody.TextAlignment;
if (shapeTextAlignment.Equals(obj))
{
    //do what you want
}

GetHashCode()

public override int GetHashCode()

Returns

int