HeaderPane
Main
Hide
Share Link
Print

SpecialDate Property, DayFormattingEventArgs Class

Returns the special date that applies to the date, or null.

Class: DayFormattingEventArgs
Namespace: Softelvdm.SftDateNET
Assembly: Softelvdm.SftDateNET

Syntax

public SpecialDateClass SpecialDate { get; }
Public ReadOnly Property SpecialDate As SpecialDateClass

Value

Comments

Returns the special date that applies to the date, or null.

Examples

C# View entire sample code

                day.Bold = false;
                day.ForeColor = Color.RoyalBlue;
                day.ToolTip = "Team meeting";
            });
        }

        // The DayFormatting event can change any day; here weekends without a special date are colored.
        private void AnyControl_DayFormatting(object sender, DayFormattingEventArgs e) {
            if (checkWeekends.Checked && e.IsWeekend && e.SpecialDate == null)
                e.ForeColor = Color.IndianRed;
        }

        private void checkWeekends_CheckedChanged(object sender, EventArgs e) {
            sftCalendar1.RefreshDays();
        }

VB.NET View entire sample code

                day.ForeColor = Color.RoyalBlue
                day.ToolTip = "Team meeting"
            End If
        Next
    End Sub

    ' The DayFormatting event can change any day; here weekends without a special date are colored.
    Private Sub AnyControl_DayFormatting(ByVal sender As Object, ByVal e As DayFormattingEventArgs) Handles SftDate1.DayFormatting, SftDate2.DayFormatting, SftDate5.DayFormatting, SftDate6.DayFormatting, SftDate7.DayFormatting, SftDate8.DayFormatting, SftDate9.DayFormatting, SftCalendar1.DayFormatting
        If CheckWeekends.Checked AndAlso e.IsWeekend AndAlso e.SpecialDate Is Nothing Then
            e.ForeColor = Color.IndianRed
        End If
    End Sub

    Private Sub CheckWeekends_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs) Handles CheckWeekends.CheckedChanged
        SftCalendar1.RefreshDays()
    End Sub

See Also DayFormattingEventArgs Class | Classes | SftDate/NET 3.0