All colors of the controls can be defined by the application: the colors of a field are properties of the SftDate control, the colors of a calendar are properties of the SftDateCalendar object returned by the Calendar property, for an SftCalendar control and for the dropdown calendar of an SftDate control (Calendar). A color left at -1 (colorSftDateDefault, the default) uses the matching Windows system color, or its dark mode counterpart while dark mode is active (see Dark Mode). While Windows High Contrast is active, the colors of the user's contrast theme are used instead (see High Contrast).

A color is an OLE_COLOR value. A Windows system color (an OLE_COLOR with the high-order bit set, such as ColorTranslator.ToOle(SystemColors.Highlight) in .NET) is used with its current RGB value; unlike the default -1, it does not follow dark mode.
In Windows Forms, the wrapper class exposes the colors of the SftDate control as System.Drawing.Color values; BackColor and ForeColor are named CtlBackColor and CtlForeColor, because Control.BackColor and Control.ForeColor exist already. The colors of the SftDateCalendar object, of special dates and of the DayFormatting event's object are uint values, converted with ColorTranslator.ToOle. The default -1 is not a System.Drawing.Color, so it is set through the control's interface (GetOcx), as the C# DemoSample does:
private const uint DefaultColor = unchecked((uint)SftDateColorConstants.colorSftDateDefault); private static uint Ole(Color color) { return (uint)ColorTranslator.ToOle(color); } private void SetColors() { SftDateCalendar cal = sftCalendar1.Calendar; cal.TitleBackColor = Ole(Color.FromArgb(0, 95, 115)); cal.TitleForeColor = Ole(Color.White); cal.SelectedBackColor = DefaultColor; sftDate1.CtlBackColor = Color.LightYellow; ISftDate ocx = (ISftDate)sftDate1.GetOcx(); ocx.SegmentHighlightBackColor = DefaultColor; }
These properties of the SftDate control define the colors of the field:
| Property | Description |
|---|---|
| BackColor, ForeColor | The background and text colors of the field. |
| SegmentHighlightBackColor, SegmentHighlightForeColor | The colors of the part of the value being edited. |
| PlaceholderForeColor | The color of the placeholder text of an empty field, of empty parts and of the value while the check box is cleared. |
| BorderColor | The color of a borderSftDateFixedSingle border (BorderStyle). |
A disabled field is shown in the system colors of disabled controls, and a disabled calendar in its DisabledForeColor color.
These properties of the SftDateCalendar object define the colors of an SftCalendar control and of the dropdown calendar of an SftDate control:
| Property | Description |
|---|---|
| BackColor, ForeColor | The background color and the color of the days. |
| TitleBackColor, TitleForeColor | The background color of the titles, and the color of the titles and the previous and next buttons. |
| DayOfWeekForeColor, BorderColor | The color of the names of the days of the week and of the line below them. |
| TrailingForeColor | The color of the days of the previous and next month. |
| WeekendForeColor | The color of Saturdays and Sundays; by default, they have the color of the other days. |
| SelectedBackColor, SelectedForeColor | The colors of selected days. |
| RangeBackColor | The background color of the days between the first and the last day of a range. |
| HotBackColor | The background color of the day under the mouse. |
| TodayColor | The color of the outline of today's date. |
| DisabledForeColor | The color of days that cannot be selected. |
| WeekNumberForeColor, WeekNumberBackColor | The colors of the week numbers. |
Special dates and the DayFormatting event define colors for individual days (see Special Dates and Day Formatting).
Colors set by the application are used as given in dark mode too; only the default colors follow the mode. An application that supports dark mode and sets its own colors defines a variant for each mode, and sets the colors again when the mode changes, as the DemoSample does in the DarkModeChange event (DarkModeChange, DarkModeChange):
private void SetColorScheme(SftDateCalendar cal, bool dark) {
cal.RangeBackColor = dark ? Ole(Color.FromArgb(95, 60, 20)) : Ole(Color.FromArgb(250, 225, 190));
cal.DayOfWeekForeColor = dark ? Ole(Color.FromArgb(110, 190, 205)) : Ole(Color.FromArgb(0, 95, 115));
}
private void sftCalendar1_DarkModeChange(object sender, AxSftDateLib20._ISftCalendarEvents_DarkModeChangeEvent e) {
SetColorScheme(sftCalendar1.Calendar, e.active);
}The application calls SetColorScheme once when the form is loaded as well, with the control's DarkModeActive property. While high contrast is active, the colors set by the application are ignored.
With UseThemes set to True (the default) and the default colors, the controls are drawn with the Windows themes of date fields and calendars. Setting a calendar's BackColor, SelectedBackColor, HotBackColor or TodayColor color draws the calendar without the theme (see Using Themes).