Class TextBoxOptions
Namespace: Aspose.Cells.Drawing.Texts
Assembly: Aspose.Cells.dll (25.2.0)
Represents the text options of the shape
public class TextBoxOptions
Inheritance
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();
int index = workbook.Worksheets[0].TextBoxes.Add(0, 0, 350, 350);
Shape shape = workbook.Worksheets[0].TextBoxes[index];
shape.Text = "This is test.";
//do your business
//Save the excel file.
workbook.Save("exmaple.xlsx");
Properties
AllowTextToOverflow
Whether allow text to overflow shape.
public bool AllowTextToOverflow { get; set; }
Property Value
Examples
csharp
[C#]
shape.TextBoxOptions.AllowTextToOverflow = true;
BottomMarginPt
Returns the bottom margin in unit of Points
public double BottomMarginPt { get; set; }
Property Value
Examples
csharp
[C#]
shape.TextBoxOptions.BottomMarginPt = 0.2d;
LeftMarginPt
Gets and sets the left margin in unit of Points.
public double LeftMarginPt { get; set; }
Property Value
Examples
csharp
[C#]
shape.TextBoxOptions.LeftMarginPt = 0.2d;
ResizeToFitText
Indicates whether to resize the shape to fit the text
public bool ResizeToFitText { get; set; }
Property Value
Examples
csharp
[C#]
shape.TextBoxOptions.ResizeToFitText = true;
RightMarginPt
Gets and sets the right margin in unit of Points.
public double RightMarginPt { get; set; }
Property Value
Examples
csharp
[C#]
shape.TextBoxOptions.RightMarginPt = 0.2d;
ShapeTextDirection
Gets or sets the text display direction within a given text body. It corresponds to “Format Shape - Text Options - Text Box - Text direction” in Excel
public TextVerticalType ShapeTextDirection { get; set; }
Property Value
Examples
csharp
[C#]
shape.TextBoxOptions.ShapeTextDirection = TextVerticalType.Vertical;
ShapeTextVerticalAlignment
It corresponds to “Format Shape - Text Options - Text Box - Vertical Alignment” in Excel.
public ShapeTextVerticalAlignmentType ShapeTextVerticalAlignment { get; set; }
Property Value
ShapeTextVerticalAlignmentType
Examples
csharp
[C#]
shape.TextBoxOptions.ShapeTextVerticalAlignment = ShapeTextVerticalAlignmentType.Left;
TopMarginPt
Gets and sets the top margin in unit of Points.
public double TopMarginPt { get; set; }
Property Value
Examples
csharp
[C#]
shape.TextBoxOptions.TopMarginPt = 0.2d;
WrapTextInShape
Specifies text wrapping within a shape. False - No wrapping will occur on text body. True - Wrapping will occur on text body.
public bool WrapTextInShape { get; set; }
Property Value
Examples
csharp
[C#]
shape.TextBoxOptions.WrapTextInShape = true;