HeaderPane
Main
Hide
Share Link
Print

High Contrast

Windows High Contrast (contrast themes) is an accessibility setting, not a visual preference. Users who enable it have committed to a specific high-contrast color scheme for everything on screen, and Microsoft's accessibility guidelines require applications to let the user's scheme win over any application-chosen colors. SftDate/OCX 2.0 supports this with the HighContrastMode property (HighContrastMode, HighContrastMode).

While high contrast is active, the controls:

  • use the system colors of the user's contrast theme for all their elements, such as the window and window text colors for the field and the days and the highlight color for the selection,
  • ignore the colors defined by the application with the color properties, special dates and the DayFormatting event - the user's contrast theme wins,
  • outline the day under the mouse instead of filling it, and draw without Windows themes,
  • do not use the dark palette - high contrast takes precedence over dark mode.

The HighContrastMode property has three values (see SftDateHighContrastConstants):

highContrastSftDateOff (default)Ignore the Windows High Contrast setting and render normally, using the colors defined by the application. Not recommended for applications which define their own colors - users with accessibility needs will see rendering that does not comply with their contrast theme.
highContrastSftDateOnAlways use the system colors, regardless of the Windows High Contrast setting. Useful for testing.
highContrastSftDateAutoFollow the Windows High Contrast setting. The control redraws when the setting changes and raises the HighContrastChange event.

The default is highContrastSftDateOff. An application should set the HighContrastMode property to highContrastSftDateAuto, at design time or once when the form is loaded:

sftDate1.HighContrastMode = SftDateHighContrastConstants.highContrastSftDateAuto;
sftCalendar1.HighContrastMode = SftDateHighContrastConstants.highContrastSftDateAuto;

The HighContrastActive property (HighContrastActive, HighContrastActive) reports whether high contrast rendering is currently in effect.

The HighContrastChange event (HighContrastChange, HighContrastChange) occurs each time the active state changes because of the Windows setting (highContrastSftDateAuto only), so the application can repaint its own user interface to match. Its Active parameter (e.active in .NET) is the new state.

Pictures, such as the pictures of special dates, are drawn as defined. Make sure that the pictures used in the calendar remain visible with the user's contrast theme colors.

Following the Windows Setting

With highContrastSftDateAuto, the control follows the Windows setting on its own, in any container: turning a contrast theme on or off changes the Windows theme, and Windows sends the WM_THEMECHANGED message to every window, the controls included. The application does not need to pass any message on.

Dark Mode

Dark mode and Windows High Contrast are independent. If both are active, high contrast takes precedence - the contrast theme's palette wins over the dark palette, because honoring the user's contrast theme is the stronger accessibility requirement (see Dark Mode).


Last Updated 11/29/2026 - (email)
© 2026 Softel vdm, Inc.