Enum ControlScrollBarType

ControlScrollBarType enumeration

Represents the type of scroll bar.

public enum ControlScrollBarType

Values

NameValueDescription
None0Displays no scroll bars.
Horizontal1Displays a horizontal scroll bar.
BarsVertical2Displays a vertical scroll bar.
BarsBoth3Displays both a horizontal and a vertical scroll bar.

Examples

[C#]

namespace Demos
{
    using Aspose.Cells;
    using Aspose.Cells.Drawing;
    using Aspose.Cells.Drawing.ActiveXControls;
    using System;

    public class ControlScrollBarTypeDemo
    {
        public static void ControlScrollBarTypeExample()
        {
            // Initialize a new workbook
            Workbook workbook = new Workbook();
            Worksheet worksheet = workbook.Worksheets[0];

            // Add a ListBox ActiveX control to the worksheet
            Shape shape = worksheet.Shapes.AddActiveXControl(ControlType.ListBox, 1, 0, 1, 0, 100, 50);
            ListBoxActiveXControl listBoxControl = (ListBoxActiveXControl)shape.ActiveXControl;

            // Set the ScrollBars property to display both horizontal and vertical scroll bars
            listBoxControl.ScrollBars = ControlScrollBarType.BarsBoth;

            // Save the workbook
            workbook.Save("ControlScrollBarTypeExample.xlsx");
            workbook.Save("ControlScrollBarTypeExample.pdf");
            return;
        }
    }
}

See Also