//create a new workbook var workbook = new GrapeCity.Documents.Excel.Workbook(); IWorksheet worksheet = workbook.Worksheets[0]; CheckBoxCellType cellType = new CheckBoxCellType { Caption = "Caption", TextTrue = "sample1", TextFalse = "sample1", TextIndeterminate = "sample1", IsThreeState = true, TextAlign = CheckBoxAlign.Right, }; CheckBoxCellType cellType2 = new CheckBoxCellType { Caption = "Caption", TextTrue = "sample2", TextFalse = "sample2", TextIndeterminate = "sample2", IsThreeState = true, TextAlign = CheckBoxAlign.Right, BoxSize = 15 }; CheckBoxCellType cellType3 = new CheckBoxCellType { Caption = "Caption", TextTrue = "sample3", TextFalse = "sample3", TextIndeterminate = "sample3", IsThreeState = true, TextAlign = CheckBoxAlign.Right, BoxSize = 18 }; worksheet.Range["A1"].CellType = cellType; worksheet.Range["A2"].CellType = cellType2; worksheet.Range["A3"].CellType = cellType3; worksheet.Range["A1:A3"].Value = false; worksheet.Range["1:3"].EntireRow.RowHeight = 20; worksheet.Range["A:A"].ColumnWidth = 15; worksheet.Range["A:A"].HorizontalAlignment = HorizontalAlignment.Center; // Save to a pdf file workbook.Save("SizeOfCheckBox.pdf");
' Create a new Workbook Dim workbook As New Workbook Dim worksheet As IWorksheet = workbook.Worksheets(0) Dim cellType As CheckBoxCellType = New CheckBoxCellType With { .Caption = "Caption", .TextTrue = "sample1", .TextFalse = "sample1", .TextIndeterminate = "sample1", .IsThreeState = True, .TextAlign = CheckBoxAlign.Right } Dim cellType2 As CheckBoxCellType = New CheckBoxCellType With { .Caption = "Caption", .TextTrue = "sample2", .TextFalse = "sample2", .TextIndeterminate = "sample2", .IsThreeState = True, .TextAlign = CheckBoxAlign.Right, .BoxSize = 15 } Dim cellType3 As CheckBoxCellType = New CheckBoxCellType With { .Caption = "Caption", .TextTrue = "sample3", .TextFalse = "sample3", .TextIndeterminate = "sample3", .IsThreeState = True, .TextAlign = CheckBoxAlign.Right, .BoxSize = 18 } worksheet.Range("A1").CellType = cellType worksheet.Range("A2").CellType = cellType2 worksheet.Range("A3").CellType = cellType3 worksheet.Range("A1:A3").Value = False worksheet.Range("1:3").EntireRow.RowHeight = 20 worksheet.Range("A:A").ColumnWidth = 15 worksheet.Range("A:A").HorizontalAlignment = HorizontalAlignment.Center ' save to a pdf file workbook.Save("SizeOfCheckBox.pdf")