[]
        
(Showing Draft Content)

IScrollBar

Interface IScrollBar

All Superinterfaces:
ICellLinkControl, ICellLinkControlT<Integer>, IControl, IControlT<IScrollBar>, IRangeBase

public interface IScrollBar extends IControlT<IScrollBar>, IRangeBase
Represents a scrollbar form control.

An IScrollBar lets users select an integer value within a range on a worksheet. It extends IRangeBase, so it supports minimum and maximum bounds, the current value, and small and large change increments. The control can be displayed horizontally or vertically.


 IScrollBar scrollBar = worksheet.getControls().addScrollBar(50, 20, 120, 20);
 scrollBar.setMin(0);
 scrollBar.setMax(100);
 scrollBar.setLargeChange(10);
 scrollBar.setOrientation(FormControlOrientation.Horizontal);
 
  • Method Details

    • getLargeChange

      int getLargeChange()
      Gets a value to be added to or subtracted from the value of a RangeBase control.

      When the user clicks the track of a ScrollBar, the value of the control increases or decreases by the value of LargeChange.

      
       IScrollBar scrollBar = worksheet.getControls().addScrollBar(50, 20, 120, 20);
       scrollBar.setLargeChange(10);
       int largeChange = scrollBar.getLargeChange();
       
      Returns:
      The large change value in the range [0, 30000].
    • setLargeChange

      void setLargeChange(int value)
      Sets a value to be added to or subtracted from the value of a RangeBase control.

      When the user clicks the track of a ScrollBar, the value of the control increases or decreases by the value of LargeChange.

      
       IScrollBar scrollBar = worksheet.getControls().addScrollBar(50, 20, 120, 20);
       scrollBar.setLargeChange(10);
       
      Parameters:
      value - [0,30000]
    • getOrientation

      FormControlOrientation getOrientation()
      Gets whether the IScrollBar is displayed horizontally or vertically.

      The returned value indicates the current orientation of the scroll bar. The default value depends on the initial width and height that is used to create this control. If width > height, the default value is FormControlOrientation.Horizontal. Otherwise, the default value is FormControlOrientation.Vertical.

      
       IScrollBar scrollBar = worksheet.getControls().addScrollBar(50, 100, 120, 40);
       scrollBar.setOrientation(FormControlOrientation.Horizontal);
       FormControlOrientation orientation = scrollBar.getOrientation();
       
      Returns:
      The current scroll bar orientation. The default value depends on the initial width and height that is used to create this control: FormControlOrientation.Horizontal if width > height; otherwise, FormControlOrientation.Vertical.
    • setOrientation

      void setOrientation(FormControlOrientation value)
      Sets whether the IScrollBar is displayed horizontally or vertically.

      Use FormControlOrientation.Horizontal to display the scroll bar horizontally, or FormControlOrientation.Vertical to display it vertically.

      
       IScrollBar scrollBar = worksheet.getControls().addScrollBar(50, 20, 120, 20);
       scrollBar.setOrientation(FormControlOrientation.Horizontal);
       
      Parameters:
      value - The scroll bar orientation. This value must be FormControlOrientation.Horizontal or FormControlOrientation.Vertical.