Syncfusion.XlsIO.Base
Example 


Syncfusion.XlsIO Namespace > IShape Interface : IsSizeWithCell Property

IsSizeWithCell Property

Indicates whether shape must be sized with cells.
Syntax
'Declaration
 
Property IsSizeWithCell As Boolean
'Usage
 
Dim instance As IShape
Dim value As Boolean
 
instance.IsSizeWithCell = value
 
value = instance.IsSizeWithCell
bool IsSizeWithCell {get; set;}
Example
By default IsSizeWithCell property is set to "false" so the shape's size will is not changed if the cell's height and width are changed. Here for example, we set IsSizeWithCell to "true".
using Syncfusion.XlsIO;
            
class Program
{
    static void Main()
    {
        using (ExcelEngine excelEngine = new ExcelEngine())
        {
            //Create worksheet
            IApplication application = excelEngine.Excel;
            IWorkbook workbook = application.Workbooks.Create(1);
            IWorksheet worksheet = workbook.Worksheets[0];
            
            //Add shape
            IShape shape = worksheet.Shapes.AddAutoShapes(AutoShapeType.Rectangle, 2, 2, 20, 70);
            
            //Set size with cells
            shape.IsSizeWithCell = true;
            
            //Save and dispose
            workbook.SaveAs("Shapes.xlsx");
            workbook.Close();
        }
    }
}
AssemblyVersion

Syncfusion.XlsIO.Base: 17.1460.0.47

See Also