Private Sub SetupMonthDimensions()
' First, determine how many months, including the current month,
' remain in the current year
Dim monthsToDisplay As Integer = Me.ultraMonthViewMulti1.CalendarInfo.MonthsOfYear.Count - DateTime.Today.Month + 1
Dim dimensions As Size
If (monthsToDisplay <= 4) Then
' If there are 4 or less months remaining, make it 1 row
dimensions = New Size(monthsToDisplay, 1)
Else
If (monthsToDisplay <= 8) Then
' If there is between 5 and 8 months remaining, make it 2 rows
dimensions = New Size(4, 2)
Else
' If there is more than 8 months remaining, make it 3 rows
dimensions = New Size(4, 3)
End If
' Set the MonthDimensions property to the new dimensions
Me.ultraMonthViewMulti1.MonthDimensions = dimensions
End If
End Sub