Back to Devexpress

FormControlCollection.AddScrollbar(CellRange) Method

officefileapi-devexpress-dot-spreadsheet-dot-formcontrolcollection-dot-addscrollbar-x28-devexpress-dot-spreadsheet-dot-cellrange-x29.md

latest2.6 KB
Original Source

FormControlCollection.AddScrollbar(CellRange) Method

Adds a scrollbar form control at a specified cell range.

Namespace : DevExpress.Spreadsheet

Assembly : DevExpress.Spreadsheet.v25.2.Core.dll

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
ScrollbarFormControl AddScrollbar(
    CellRange targetRange
)
vb
Function AddScrollbar(
    targetRange As CellRange
) As ScrollbarFormControl

Parameters

NameTypeDescription
targetRangeCellRange

A cell range where the form control should be located.

|

Returns

TypeDescription
ScrollbarFormControl

The scrollbar form control.

|

Remarks

Example

The code sample below creates a scrollbar form control:

csharp
Workbook workbook = new Workbook();
workbook.LoadDocument("Document.xlsx");

var formControls = workbook.Worksheets[0].FormControls;

var cellRange = workbook.Worksheets[0].Range["B2:B8"];
var scrollbarFormControl = formControls.AddScrollbar(cellRange);
scrollbarFormControl.Min = 2;
scrollbarFormControl.Max = 15;
scrollbarFormControl.LargeChange = 10;
scrollbarFormControl.SmallChange = 1;
vb
Dim workbook As New Workbook()
workbook.LoadDocument("Document.xlsx")

Dim formControls = workbook.Worksheets(0).FormControls

Dim cellRange = workbook.Worksheets(0).Cells("B2:B8")
Dim scrollbarFormControl = formControls.AddScrollbar(cellRange))
scrollbarFormControl.Min = 2
scrollbarFormControl.Max = 15
scrollbarFormControl.LargeChange = 10
scrollbarFormControl.SmallChange = 1

Note

The FormControlCollection.AddScrollbar method call adds a new item to both FormControlCollection and ShapeCollection.

See Also

FormControlCollection Interface

FormControlCollection Members

DevExpress.Spreadsheet Namespace