Infragistics(R) NetAdvantage(R) Windows Forms
Scrollbars Enumeration
Example  See Also  E-mail your feedback on this topic.
Infragistics.Win.UltraWinGrid Namespace : Scrollbars Enumeration

Specifies if vertical and/or horizontal scrollbars will be shown

Syntax

Visual Basic (Declaration) 
Public Enum Scrollbars 
   Inherits System.Enum
C# 
public enum Scrollbars : System.Enum 

Members

MemberDescription
Automatic display either scroll bar as necessary
Both show both horizontal and vertical scroll bars
Horizontal show horizontal scroll bar only
None no scroll bars are to be shown
Vertical show vertical scroll bar only

Example

Following code sets some of the properties related to scrollbars in the UltraGrid.

Visual BasicCopy Code
Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinGrid

  Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
      ' Set the scroll style to Immediate so the UltraGrid scrolls the rows immediately
      ' as soon as the user drags the thumb rather than waiting untill the scroll thumb is
      ' released.
      Me.UltraGrid1.DisplayLayout.ScrollStyle = ScrollStyle.Immediate

      ' Scrollbars indicates which of the vertical and horizontal scrollbars if any gets 
      ' shown and how.
      Me.UltraGrid1.DisplayLayout.Scrollbars = Scrollbars.Both

      ' Setting ScrollBounds to ScrollToFill will prevent the user from scrolling further
      ' down as soon as the last row is fully visible.
      Me.UltraGrid1.DisplayLayout.ScrollBounds = ScrollBounds.ScrollToFill

      ' If you want to prevent the row selectors from scrolling out of view when you 
      ' horizontally scroll columns set the UseFixedHeaders to true. This enables the 
      ' fixed headers functionality which also allows the user to freeze/unfreeze
      ' columns.
      Me.UltraGrid1.DisplayLayout.UseFixedHeaders = True

      ' Set verious scrollbar related properties using ScrollBarLook object returned
      ' by ScrollBarLook property.
      Me.UltraGrid1.DisplayLayout.ScrollBarLook.MinMaxButtonsVisible = True

      ' Set the style of the scroll bar arrows.
      Me.ultraGrid1.DisplayLayout.ScrollBarLook.ScrollBarArrowStyle = _
          Infragistics.Win.UltraWinScrollBar.ScrollBarArrowStyle.BothAtRightBottom

      ' Set appearances for various ui elements of the scroll bar.
      Me.UltraGrid1.DisplayLayout.ScrollBarLook.Appearance.ThemedElementAlpha = Alpha.Transparent
      Me.UltraGrid1.DisplayLayout.ScrollBarLook.Appearance.BackColor = Color.Silver
      Me.UltraGrid1.DisplayLayout.ScrollBarLook.Appearance.BackColor2 = Color.SkyBlue
      Me.UltraGrid1.DisplayLayout.ScrollBarLook.Appearance.BackGradientStyle = GradientStyle.Vertical

      Me.UltraGrid1.DisplayLayout.ScrollBarLook.ButtonAppearance.ThemedElementAlpha = Alpha.Transparent
      Me.UltraGrid1.DisplayLayout.ScrollBarLook.ButtonAppearance.BackColor = Color.Blue
      Me.UltraGrid1.DisplayLayout.ScrollBarLook.ButtonAppearance.ForeColor = Color.LightYellow

      ' When true, scroll notifications as a result of a scroll arrow or scroll track click 
      ' will occur synchronously thus giving scrolling higher priority when cpu intensive
      ' tasks are being performed.
      Me.UltraGrid1.DisplayLayout.PriorityScrolling = True
  End Sub
C#Copy Code
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinGrid;
using System.Diagnostics;

private void button1_Click(object sender, System.EventArgs e)
{
	// Set the scroll style to Immediate so the UltraGrid scrolls the rows immediately
	// as soon as the user drags the thumb rather than waiting untill the scroll thumb is
	// released.
	this.ultraGrid1.DisplayLayout.ScrollStyle = ScrollStyle.Immediate;

	// Scrollbars indicates which of the vertical and horizontal scrollbars if any gets 
	// shown and how.
	this.ultraGrid1.DisplayLayout.Scrollbars = Scrollbars.Both;

	// Setting ScrollBounds to ScrollToFill will prevent the user from scrolling further
	// down as soon as the last row is fully visible.
	this.ultraGrid1.DisplayLayout.ScrollBounds = ScrollBounds.ScrollToFill;

	// If you want to prevent the row selectors from scrolling out of view when you 
	// horizontally scroll columns set the UseFixedHeaders to true. This enables the 
	// fixed headers functionality which also allows the user to freeze/unfreeze
	// columns.
	this.ultraGrid1.DisplayLayout.UseFixedHeaders = true;

	// Set verious scrollbar related properties using ScrollBarLook object returned
	// by ScrollBarLook property.
	this.ultraGrid1.DisplayLayout.ScrollBarLook.MinMaxButtonsVisible = true;

	// Set the style of the scroll bar arrows.
	this.ultraGrid1.DisplayLayout.ScrollBarLook.ScrollBarArrowStyle = 
		Infragistics.Win.UltraWinScrollBar.ScrollBarArrowStyle.BothAtRightBottom;

	// Set appearances for various ui elements of the scroll bar.
	this.ultraGrid1.DisplayLayout.ScrollBarLook.Appearance.ThemedElementAlpha = Alpha.Transparent;
	this.ultraGrid1.DisplayLayout.ScrollBarLook.Appearance.BackColor = Color.Silver;
	this.ultraGrid1.DisplayLayout.ScrollBarLook.Appearance.BackColor2 = Color.SkyBlue;
	this.ultraGrid1.DisplayLayout.ScrollBarLook.Appearance.BackGradientStyle = GradientStyle.Vertical;
				
	this.ultraGrid1.DisplayLayout.ScrollBarLook.ButtonAppearance.ThemedElementAlpha = Alpha.Transparent;
	this.ultraGrid1.DisplayLayout.ScrollBarLook.ButtonAppearance.BackColor = Color.Blue;
	this.ultraGrid1.DisplayLayout.ScrollBarLook.ButtonAppearance.ForeColor = Color.LightYellow;

	// When true, scroll notifications as a result of a scroll arrow or scroll track click 
	// will occur synchronously thus giving scrolling higher priority when cpu intensive
	// tasks are being performed.
	this.ultraGrid1.DisplayLayout.PriorityScrolling = true;
}

See Also