Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinGrid
Imports System.Diagnostics
Private Sub Button135_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button135.Click
Debug.WriteLine("Scroll regions and their dimensions: ")
' Loop throgh the row scroll regions.
Dim i As Integer
For i = 0 To Me.UltraGrid1.DisplayLayout.RowScrollRegions.Count - 1
Dim rowRegion As RowScrollRegion = Me.UltraGrid1.DisplayLayout.RowScrollRegions(i)
' Loop through the col scroll regions.
Dim j As Integer
For j = 0 To Me.UltraGrid1.DisplayLayout.ColScrollRegions.Count - 1
Dim colRegion As ColScrollRegion = Me.UltraGrid1.DisplayLayout.ColScrollRegions(j)
' Get the left and the width from the column scroll region.
Dim left As Integer = colRegion.Left
Dim width As Integer = colRegion.Width
' Get the top and the height from the row scroll region.
Dim top As Integer = rowRegion.Top
Dim height As Integer = rowRegion.Height
Dim scrollRegionRect As Rectangle = New Rectangle(left, top, width, height)
' Print out the scroll region in the form of indexes of the row scroll region and the
' col scroll region whose intersection forms the scroll region and its dimension.
Debug.Write(" (" & rowRegion.Index & ", " & colRegion.Index & ") " & scrollRegionRect.ToString())
Next
Debug.WriteLine("")
Next
End Sub