File Formats

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Interface ICheckBoxShape

    Show / Hide Table of Contents

    Interface ICheckBoxShape

    This interface represents TextBox form control shape.

    Inherited Members
    ITextBox.HAlignment
    ITextBox.VAlignment
    ITextBox.TextRotation
    ITextBox.IsTextLocked
    ITextBox.RichText
    ITextBox.Text
    IShape.Remove()
    IShape.Scale(Int32, Int32)
    IShape.Height
    IShape.Id
    IShape.Left
    IShape.Name
    IShape.Top
    IShape.Width
    IShape.ShapeType
    IShape.IsShapeVisible
    IShape.AlternativeText
    IShape.IsMoveWithCell
    IShape.IsSizeWithCell
    IShape.Fill
    IShape.Line
    IShape.OnAction
    IShape.Shadow
    IShape.ThreeD
    IShape.ShapeRotation
    IShape.TextFrame
    IShape.Hyperlink
    IParentApplication.Application
    IParentApplication.Parent
    Namespace: Syncfusion.XlsIO
    Assembly: Syncfusion.XlsIO.Base.dll
    Syntax
    public interface ICheckBoxShape : ITextBoxShape, ITextBox, IShape, IParentApplication

    Properties

    CheckState

    Indicates whether check box is checked.

    Declaration
    ExcelCheckState CheckState { get; set; }
    Property Value
    Type Description
    ExcelCheckState
    Examples

    By default, Unchecked is set to CheckState property. Here for example, we set Checked to CheckState.

            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
                ICheckBoxShape checkbox = worksheet.Shapes.AddCheckBox();
    
                //Set checkbox state
                checkbox.CheckState = ExcelCheckState.Checked;
    
                //Set text
                checkbox.Text = "Checkbox select";
    
                //Save and dispose
                workbook.SaveAs("Shapes.xlsx");
                workbook.Close();
            }

    LinkedCell

    Indicates the cell in which the option button points to

    Declaration
    IRange LinkedCell { get; set; }
    Property Value
    Type Description
    IRange
    Examples

    The following code illustrates how to set LinkedCell for the checkbox.

            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
                ICheckBoxShape checkbox = worksheet.Shapes.AddCheckBox();
    
                //Set linked cell
                checkbox.LinkedCell = worksheet["C7"];
    
                //Save and dispose
                workbook.SaveAs("Shapes.xlsx");
                workbook.Close();
            }
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved