Imports Infragistics.Win
Imports Infragistics.Win.UltraWinSchedule
Imports Infragistics.Win.UltraWinSchedule.MonthViewMulti
Private Sub SetupMonthOrientation()
' If there is only one month (or less) visible, the property
' setting is not applicable, so return
If (Me.ultraMonthViewMulti1.VisibleMonths.Count <= 1) Then Return
' If there are 6 or more months being displayed, set the orientation
' to DownThenAcross, otherwise to AcrossThenDown
If (Me.ultraMonthViewMulti1.VisibleMonths.Count >= 6) Then
Me.ultraMonthViewMulti1.MonthOrientation = MonthOrientation.DownThenAcross
Else
Me.ultraMonthViewMulti1.MonthOrientation = MonthOrientation.AcrossThenDown
End If
' Set the MonthPadding to be proportional to the number of
' months being displayed by the control
Dim numberOfMonths As Integer = Me.ultraMonthViewMulti1.CalendarInfo.MonthsOfYear.Count
If (Me.ultraMonthViewMulti1.VisibleMonths.Count <= numberOfMonths) Then
Dim padSize As Integer = numberOfMonths - Me.ultraMonthViewMulti1.VisibleMonths.Count
Dim padding As Size = New Size(padSize, padSize)
Me.ultraMonthViewMulti1.MonthPadding = padding
Else
Me.ultraMonthViewMulti1.MonthPadding = New Size(2, 2)
End If
End Sub