Syncfusion.XlsIO.Base
Example 


TextFrame Property (IShape)

Returns a ITextFrame object that contains the alignment and anchoring properties for the specified shape. Read-only.
Syntax
'Declaration
 
ReadOnly Property TextFrame As ITextFrame
'Usage
 
Dim instance As IShape
Dim value As ITextFrame
 
value = instance.TextFrame
ITextFrame TextFrame {get;}
Example
The following code illustrates how to access TextFrame property.
using Syncfusion.XlsIO;
            
class Program
{
    static void Main()
    {
        using (ExcelEngine excelEngine = new ExcelEngine())
        {
            //Create worksheet
            IApplication application = excelEngine.Excel;
            application.DefaultVersion = ExcelVersion.Excel2013;
            IWorkbook workbook = application.Workbooks.Create(1);
            IWorksheet worksheet = workbook.Worksheets[0];
            
            //Add shape
            IShape shape = worksheet.Shapes.AddAutoShapes(AutoShapeType.Rectangle, 2, 2, 40, 100);
            
            //Set text frame
            ITextFrame textFrame = shape.TextFrame;
            
            //Set text range
            ITextRange textRange = textFrame.TextRange;
            
            //Set text
            textRange.Text = "Sample";
            
            //Set alignment
            textFrame.HorizontalAlignment = ExcelHorizontalAlignment.Right;
            
            //Save and dispose
            workbook.SaveAs("Shapes.xlsx");
            workbook.Close();
        }
    }
}
AssemblyVersion

Syncfusion.XlsIO.Base: 17.1460.0.32

See Also