MonthColumns, MonthRows Properties, ComputeControlSize Method

Purpose

Returns or sets a value that specifies the number of months to be displayed horizontally and vertically. ComputeControlSize returns the width and height of a MonthView control for a given number of rows and columns.

Syntax

MonthView.MonthColumns [= number]

MonthView.MonthRows [= number]

MonthView.ComputeControlSize(Rows%, Columns%, Width!, Height!)

Description

The MonthColumns and MonthRows give you the ability to display more than one month at a time.

The MonthColumns property allows you to specify the number of months that will be displayed horizontally. The MonthRows property allows you to specify the number of months that will be displayed vertically.

The control can display up to twelve months.

The ComputeControlSize method is used to calculate the width and the height of the MonthView control. It takes the Rows% and Columns% as input parameters and returns the calculated size in the Width! and Height! variables.

Example

OpenW 1, 0, 0

Ocx MonthView mvw

mvw.MonthColumns = 2

mvw.MonthRows = 2

Local Single h, w

~mvw.ComputeControlSize(2, 2, w, h)

// Use of reserved words as below results in an error

// Dim Width As Single, Height As Single

// ~mvw.ComputeControlSize(2, 2, Width, Height)

Debug "Width = "; w

Debug "Height = "; h

Win_1.Width = PixelsToTwipX(w + (2 * Screen.cxFrame))

Win_1.Height = PixelsToTwipY(h + (2 * Screen.cyFrame) + Screen.cyCaption)

Debug.Show

~SetWindowPos(Debug.hWnd, 0, w + 60, 0, 200, 200, 0)

Do : Sleep : Until Me Is Nothing

Debug.Hide

See Also

MonthView

{Created by Sjouke Hamstra; Last updated: 18/10/2014 by James Gaite}