property G2antt.ScrollBars as ScrollBarsEnum
Returns or sets a value that determines whether the control has horizontal and/or vertical scroll bars.

 TypeDescription 
   ScrollBarsEnum A ScrollBarsEnum expression that identifies which scroll bars are visible.  

Use the ScrollBars property to show, enable or disable the control's scroll bars. By default, the ScrollBars property is exBoth, so both scroll bars are used if necessarily. For instance, if the ScrollBars property is exNone the control displays no scroll bars. Use the ScrollPos property to get the control's scroll position. Use the EnsureVisibleItem method to ensure that an item fits the control's client area. Use the EnsureVisibleColumn method to ensure that a specified column fits the control's client area. Use the Scroll method to scroll programmatically the control. Use the ScrollOrderParts property to customize the order of the buttons in the scroll bar. The RightToLeft property flips the order of the control's elements from right to left. Use the FirstVisibleDate property to scroll the chart's date.

The following screen shots shows all 3 scrollbars that can be visible in the control:

The control provides up to 3 scroll bars. The vertical scroll bar is displayed on the right side of the control ( RightToLeft property is False ) and it scrolls the items, rows ( nodes ). The other 2 scroll bars are for scrolling the columns section and the chart area. The ScrollBar property of the Chart object specifies whether the chart displays the horizontal scroll bar. 

  1. vertical scroll bar. Use the methods such us: Scroll, ScrollPos, EnsureVisibleItem to scroll vertically the control ( scroll vertically the rows, items or nodes ). The vertical scroll bar is displayed only if it required, if the ScrollBars property is exBoth or exVertical. The vertical scroll bar is always visible if the ScrollBars property is exDisableBoth or exDisableNoVertical.
  2. horizontal scroll bar. Use the methods such us: Scroll, ScrollPos, EnsureVisibleColumn to scroll horizontally the control ( scrolls horizontally the columns section ). The horizontal scroll bar is displayed only if it required, if the ScrollBars property is exBoth or exHorizontal. The horizontal scroll bar is always visible if the ScrollBars property is exDisableBoth or exDisableNoHorizontal. The ColumnAutoResize property specifies whether all visible columns fit the control's area ( so no horizontal scroll bar is shown ). 
  3. chart scroll bar. Use the methods such us: Chart.ScrollTo, FirstVisibleDate to browse for a new date ( scrolls horizontally the chart area, so a new range of dates are being displayed )

If the Scroll(exScrollVTo) does not work please check if the ScrollBars property includes the exVScrollOnThumbRelease, and use a code like follows:

With G2antt1
    .ScrollBars = .ScrollBars And Not exVScrollOnThumbRelease
    .Scroll exScrollVTo, 10000
    .ScrollBars = .ScrollBars Or exVScrollOnThumbRelease
End With

The code removes temporary the exVScrollOnThumbRelease flag from the ScrollBars property, performs the scrolling ( jump to row 10000 ) , and restore back the exVScrollOnThumbRelease flag.

The following VB sample scrolls vertically the control to row 100:

G2antt1.Scroll exScrollVTo, 100

Send comments on this topic.
1999-2017 Exontrol.COM, Software. All rights reserved.