TitleBackColor, TitleForeColor, TrailingForeColor, MonthBackColor Properties (MonthView)

Purpose

These properties returns or sets a value that specifies the color displayed within a several areas of the MonthView Ocx control.

Syntax

MonthView.TitleBackColor [= color]

MonthView.TitleForeColor [= color]

MonthView.TrailingForeColor [= color]

MonthView.MonthBackColor [= color]

color:iexp; RGB color

Description

The TitleBackColor and TitleForeColor properties specify the background and foreground colors of the title area of the control.

The TrailingForeColor property determines the color of trailing dates. Trailing dates are day numbers that are displayed which precede and follow day numbers of the currently selected month. By default, trailing dates are displayed in white.

The MonthBackColor property determines the background color displayed within a month.

On later versions of Windows (especially Windows 8), these properties have no effect as they are fixed by the OS.

Example

// On later versions of Windows, these properties have no effect

Ocx MonthView mvw

With mvw

.TitleBackColor = QBColor(2)

.TitleForeColor = QBColor(15)

.TrailingForeColor = QBColor(2)

.MonthBackColor = QBColor(8)

End With

Ocx Command cmd(1) = "Change TitleBackColor", mvw.Width + 10, 10, 140, 22

Ocx Command cmd(2) = "Change TitleForeColor", mvw.Width + 10, 40, 140, 22

Ocx Command cmd(3) = "Change TrailingForeColor", mvw.Width + 10, 70, 140, 22

Ocx Command cmd(4) = "Change MonthBackColor", mvw.Width + 10, 100, 140, 22

Do : Sleep : Until Me Is Nothing

 

Sub cmd_Click(Index%)

Ocx CommDlg cd

Select Index%

Case 1 : cd.Color = mvw.TitleBackColor

Case 2 : cd.Color = mvw.TitleForeColor

Case 3 : cd.Color = mvw.TrailingForeColor

Case 4 : cd.Color = mvw.MonthBackColor

EndSelect

cd.ShowColor

Trace cd.Color

Select Index%

Case 1 : mvw.TitleBackColor = cd.Color

Case 2 : mvw.TitleForeColor = cd.Color

Case 3 : mvw.TrailingForeColor = cd.Color

Case 4 : mvw.MonthBackColor = cd.Color

EndSelect

EndSub

See Also

MonthView

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