DayBold, DayVisible, VisibleDays Properties, GetDayBold Event (MonthView)

Purpose

DayBold returns or sets a value that determines if a displayed day is bold. DayVisible returns a Boolean indicating whether the date is visible. The VisibleDays property returns an array containing the dates that are currently visible.

Syntax

MonthView.DayBold(date) [ = Boolean ]

MonthView.DayVisible(date)

MonthView.VisibleDays(index%)

Sub MonthView_GetDayBold(StartDate As Date, Count%, State?())

Description

The date parameter in the DayBold(date) property specifies a date found in the VisibleDays property and DayBold specifies whether or not the date is bolded (True).

The DayBold property is an array that corresponds to the VisibleDays property. Each Boolean element indicates whether its corresponding date should be displayed in bold. Only dates that are currently displayed are valid. Valid dates can be found by looking in the VisibleDays property.

The index parameter in the VisibleDays(index) is an integer which specifies a displayed date on the calendar. Index can be any value from 1 to 41. A value of 1 indicates the first date that is currently displayed.

Only dates that are currently displayed can be found in the VisibleDays property. In addition, the number of visible days can changes depending on the settings of the MonthColumns and MonthRows properties. As you move from month to month, the information in this property is not preserved.

The DayVisible(date) property returns a Boolean indicating if the specified date is currently visible in the MonthView Ocx.

The GetDayBold event occurs when the control needs to display a date, in order to get bold information. The event can be used to set the boldness of days as they are brought into view. The event has three parameters. StartDate specifies the first date that is displayed, count the number of days that are displayed, and State?() is an array of Boolean values that specify if a date is bold.

Example

OpenW 1, , , 260, 220

Ocx MonthView mvw = "", 10, 10, 0, 0 /* Width and Height are ignored

.DayBold(.VisibleDays(1)) = True

.DayBold(.VisibleDays(41)) = True

Print .DayVisible(Date)

Local n

For n = 1 To 41 : Debug mvw.VisibleDays(n) : Next n

Do : Sleep : Until Win_1 Is Nothing

 

Sub mvw_GetDayBold(StartDate As Date, Count%, State?())

See Also

MonthView

{Created by Sjouke Hamstra; Last updated: 28/09/2014 by James Gaite}