This documentation is archived and is not being maintained.

MonthCalendar.SetCalendarDimensions Method

Sets the number of columns and rows of months to display.

[Visual Basic]
Public Sub SetCalendarDimensions( _
   ByVal x As Integer, _
   ByVal y As Integer _
public void SetCalendarDimensions(
 int x,
 int y
public: void SetCalendarDimensions(
 int x,
 int y
public function SetCalendarDimensions(
   x : int,
 y : int


The number of columns.
The number of rows.


Exception Type Condition
ArgumentException The x parameter or the y parameter is less than zero.


The maximum number of months that you can display is 12, restricted to one calendar year. The product of the x and y parameters should be 12 or less. For values of x and y that have a product of more than 12, the greater of the x and y values will be iteratively reduced until the product is 12 or less.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

MonthCalendar Class | MonthCalendar Members | System.Windows.Forms Namespace | CalendarDimensions