Provides data for the SftDate.DayFormatting event, which defines how a calendar shows a day.
The event is raised for each day before it is shown. The properties start with the values defined by the calendar settings and the special dates; an event handler changes them. A disabled day cannot be selected.
Namespace: Softelvdm.SftDateNET
Assembly: Softelvdm.SftDateNET
Inheritance
public class DayFormattingEventArgs : System.EventArgs;
Public Class DayFormattingEventArgs
Inherits System.EventArgsThis class cannot be instantiated.
![]() | BackColor | Defines the background color of the day, or Color.Empty for the default. |
![]() | Bold | Defines whether the day is shown in bold. |
![]() | Date | Returns the date. |
![]() | Enabled | Defines whether the day can be selected. |
![]() | Font | Defines the font of the day, or null for the calendar's font. |
![]() | ForeColor | Defines the text color of the day, or Color.Empty for the default. |
![]() | Image | Defines an image shown with the day, or null. |
![]() | InRange | Returns whether the date is within the range of dates that can be selected (SftDate.MinDate and SftDate.MaxDate). |
![]() | IsToday | Returns whether the date is today's date. |
![]() | IsWeekend | Returns whether the date falls on a Saturday or Sunday. |
![]() | SpecialDate | Returns the special date that applies to the date, or null. |
![]() | Text | Defines the text shown for the day, or null for the day number. |
![]() | ToolTip | Defines the tooltip of the day, or an empty string for none. |
![]() ![]() ![]() | Empty | Provides a value to use with events that do not have event data. |
![]() ![]() | Equals | Determines whether the specified object is equal to the current object. |
![]() ![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. |
![]() ![]() | GetHashCode | Serves as the default hash function. |
![]() ![]() | GetType | Gets the Type of the current instance. |
![]() ![]() | MemberwiseClone | Creates a shallow copy of the current Object. |
![]() ![]() ![]() | ReferenceEquals | Determines whether the specified Object instances are the same instance. |
![]() ![]() | ToString | Returns a string that represents the current object. |
day = calendar.SpecialDates.Add(monday, RecurrenceEnum.Weekly);
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();
}
day.Bold = False
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()See Also Classes | SftDate/NET 3.0