alexa
menu

MAUI

  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Search Results for

    Show / Hide Table of Contents

    Interface ICheckBoxes

    This interface represents CheckBoxes collection inside single worksheet.

    Namespace: Syncfusion.XlsIO
    Assembly: Syncfusion.XlsIO.NET.dll
    Syntax
    public interface ICheckBoxes

    Properties

    Count

    Returns number of ICheckBoxShape objects in the ICheckBoxes collection.

    Declaration
    int Count { get; }
    Property Value
    Type
    int
    Examples

    The following code illustrates how to access Count property.

            using (ExcelEngine excelEngine = new ExcelEngine())
            {
                //Create worksheet
                IApplication application = excelEngine.Excel;
                IWorkbook workbook = application.Workbooks.Create(1);
                IWorksheet worksheet = workbook.Worksheets[0];
    
                //Add combobox
                worksheet.CheckBoxes.AddCheckBox(1, 1, 20, 100);
                worksheet.CheckBoxes.AddCheckBox(5, 5, 20, 100);
    
                //Check count
                Console.Write(worksheet.CheckBoxes.Count);
    
                //Save and dispose
                workbook.SaveAs("Shapes.xlsx");
                workbook.Close();
                Console.ReadKey();
            }
    //Output will be
    //2

    this[int]

    Returns single ICheckBoxShape from the ICheckBoxes collection.

    Declaration
    ICheckBoxShape this[int index] { get; }
    Parameters
    Type Name Description
    int index

    Item's index to get.

    Property Value
    Type Description
    ICheckBoxShape

    Single item from the collection.

    Examples

    The following code illustrates how to access a ICheckBoxShape from the ICheckBoxes collection.

    using (ExcelEngine excelEngine = new ExcelEngine())
    {
        //Create worksheet
        IApplication application = excelEngine.Excel;
        IWorkbook workbook = application.Workbooks.Create(1);
        IWorksheet worksheet = workbook.Worksheets[0];
    
        //Add combobox
        worksheet.CheckBoxes.AddCheckBox(1, 1, 20, 100);
        worksheet.CheckBoxes.AddCheckBox(5, 5, 20, 100);
    
        //Set name
        worksheet.CheckBoxes[0].Name = "CheckBox1";
    
        //Save and dispose
        workbook.SaveAs("Shapes.xlsx");
        workbook.Close();
    }

    this[string]

    Gets single ICheckBoxShape from the ICheckBoxes collection.

    Declaration
    ICheckBoxShape this[string name] { get; }
    Parameters
    Type Name Description
    string name

    Name of the item to get.

    Property Value
    Type Description
    ICheckBoxShape

    Single item from the collection.

    Examples

    The following code illustrates how to access a ICheckBoxShape from the ICheckBoxes collection.

            using (ExcelEngine excelEngine = new ExcelEngine())
            {
                //Create worksheet
                IApplication application = excelEngine.Excel;
                IWorkbook workbook = application.Workbooks.Create(1);
                IWorksheet worksheet = workbook.Worksheets[0];
    
                //Add combobox
                worksheet.CheckBoxes.AddCheckBox(1, 1, 20, 100);
    
                //Set name
                worksheet.CheckBoxes[0].Name = "CheckBox1";
    
                //Get width
                Console.Write(worksheet.CheckBoxes["CheckBox1"].Width);
    
                //Save and dispose
                workbook.SaveAs("Shapes.xlsx");
                workbook.Close();
                Console.ReadKey();
            }
    //Output will be
    //100

    Methods

    AddCheckBox(int, int, int, int)

    Adds new ICheckBoxShape to the ICheckBoxes collection.

    Declaration
    ICheckBoxShape AddCheckBox(int row, int column, int height, int width)
    Parameters
    Type Name Description
    int row

    One-based row index of the top-left corner of the new item.

    int column

    One-based column index of the top-left corner of the new item.

    int height

    Height in pixels of the new item.

    int width

    Width in pixels of the new item.

    Returns
    Type Description
    ICheckBoxShape

    Newly added item.

    Examples

    The following code illustrates how to Add a ICheckBoxShape object to the ICheckBoxes collection.

    using (ExcelEngine excelEngine = new ExcelEngine())
    {
        //Create worksheet
        IApplication application = excelEngine.Excel;
        IWorkbook workbook = application.Workbooks.Create(1);
        IWorksheet worksheet = workbook.Worksheets[0];
    
        //Add combobox
        ICheckBoxShape checkbox = worksheet.CheckBoxes.AddCheckBox(1, 1, 20, 100);
    
        //Save and dispose
        workbook.SaveAs("Shapes.xlsx");
        workbook.Close();
    }
    In this article
    Back to top Generated by DocFX
    Copyright © 2001 - 2026 Syncfusion Inc. All Rights Reserved