//create a new workbook var workbook = new GrapeCity.Documents.Excel.Workbook(); IWorksheet ws = workbook.Worksheets["Sheet1"]; ws.Range["8:8"].RowHeight = 7.8d; ws.Range["9:9"].RowHeight = 25.8d; ws.Range["A:A"].ColumnWidthInPixel = 36d; // Unbound mode ws.Range["B2"].Value = "Spinners support unbound mode. You can modify its value with code."; var spinner1 = ws.Controls.AddSpinner(33.3, 36.2, 36.3, 41.5); spinner1.Max = 10; spinner1.Min = 1; spinner1.Value = 6; // Data binding ws.Range["B7"].Value = "The following spinner is similar to a numeric up-down. Because it's linked to a cell."; ws.Range["B9"].Value = 6d; var b9 = ws.Range["B9"]; b9.HorizontalAlignment = HorizontalAlignment.Left; b9.VerticalAlignment = VerticalAlignment.Center; b9.AddIndent = false; var spinner2 = ws.Controls.AddSpinner(48.5, 113.5, 25.5, b9.Height - 2); spinner2.Max = 10; spinner2.Min = 1; spinner2.Display3DShading = false; spinner2.LinkedCell = b9; spinner2.Value = 6; // Save to an excel file workbook.Save("SpinnersBasicUsage.xlsx");
' Create a new Workbook Dim workbook As New Workbook Dim ws As IWorksheet = workbook.Worksheets("Sheet1") ws.Range("8:8").RowHeight = 7.8R ws.Range("9:9").RowHeight = 25.8R ws.Range("A:A").ColumnWidthInPixel = 36.0R ' Unbound mode ws.Range!B2.Value = "Spinners support unbound mode. You can modify its value with code." With ws.Controls.AddSpinner(33.3, 36.2, 36.3, 41.5) .Max = 10 .Min = 1 .Value = 6 End With ' Data binding ws.Range!B7.Value = "The following spinner is similar to a numeric up-down. Because it's linked to a cell." ws.Range!B9.Value = 6.0R Dim b9 = ws.Range!B9 With b9 .HorizontalAlignment = HorizontalAlignment.Left .VerticalAlignment = VerticalAlignment.Center .AddIndent = False End With With ws.Controls.AddSpinner(48.5, 113.5, 25.5, b9.Height - 2) .Max = 10 .Min = 1 .Display3DShading = False .LinkedCell = b9 .Value = 6 End With ' save to an excel file workbook.Save("SpinnersBasicUsage.xlsx")