method G2antt.Scroll (Type as ScrollEnum, [ScrollTo as Variant])
Scrolls the control's content.

TypeDescription
Type as ScrollEnum A ScrollEnum expression that indicates type of scrolling being performed.
ScrollTo as Variant A long expression that indicates the position where the control is scrolled when Type is exScrollVTo or exScrollHTo. If the ScrollTo parameter is missing, 0 value is used.
Use the Scroll method to scroll the control's content by code. Use the EnsureVisibleItem method to ensure that a specified item fits the control's client area. Use the ScrollPos property to get the control's scroll position. Use the EnsureVisibleColumn method to ensure that a specified column fits the control's client area. If the Type parameter is exScrollLeft, exScrollRight or exScrollHTo the Scroll method scrolls horizontally the control's content pixel by pixel, if the ContinueColumnScroll property is False, else the Scroll method scrolls horizontally the control's content column by column. Use the ScrollTo method to ensure that a specified date fits the chart's client area. The FirstVisibleDate property specifies the first visible date.

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 the control's content to the first item ( scrolls to the top ):

G2antt1.Scroll exScrollVTo, 0

The following C++ sample scrolls the control's content to the top:

m_g2antt.Scroll( 2 /*exScrollVTo*/, COleVariant( (long)0 ) );

The following C# sample scrolls the control's content to the top:

axG2antt1.Scroll(EXG2ANTTLib.ScrollEnum.exScrollVTo, 0);

The following VB.NET sample scrolls the control's content to the top:

AxG2antt1.Scroll(EXG2ANTTLib.ScrollEnum.exScrollVTo, 0)

The following VFP sample scrolls the control's content to the top:

with thisform.G2antt1
	.Scroll( 2, 0 ) && exScrollVTo
endwith