Reference > WeekDay Object > WeekDay Object Properties > Attribute Property (WeekDay) |
The Attribute property determines which attribute style in the AttribStylesCollection should be used for the weekday.
object.Attribute= variant
Read/Write at run time. Not available at design time.
Integer, String, Object (AttribStyle)
Weeks that are specified as weekends for a particular weekday will use this attribute settings.
With Calendar.WeekDays("SunAttrib")
.Attribute.BackColor = RGB(255,255,255)
.Attribute.ForeColor = RGB(255,0,0)
End With
Calendar.WeekRests(1) = -1 ' All weeks as weekends
This shows that all weeks for Sunday will be treated as weekends, and the background color will be white with the text in red.
The Attribute property uses a variant data type, and an AttribStyle object can be applied to the property in the following three ways:
Calendar.WeekDays("Sun").Attribute = 1 ' Index no.
Calendar.WeekDays("Sun").Attribute = "SunAttrib" ' String
Set Calendar.WeekDays("Sun").Attribute = _
Calendar.AttribStyles(1) ' Object
By setting the ReflectToTitle property either to 1-BackColor, 2-ForeColor, or 3-Both, the settings in the Attribute property will be reflected to the appropriate weekday title.
When nothing is set in the Attribute property (set to Null), a default attribute style registered in the control (AttribStylesCollection) will be used instead.
See Also
ReflectToTitle Property (WeekDay)