HeaderPane
Main
Hide
Share Link
Print

Using Themes

The SftDate and SftCalendar controls use Windows themes (visual styles) by default, so they match the standard Windows controls of the application. If Windows themes are not available, the controls use their built-in display style.

SftDate_SetUseThemes defines whether a control can use Windows themes. If set to FALSE, themes are not honored and the control is drawn using the built-in style, even if Windows themes are available; SftDate_GetUseThemes returns the setting. For a field, the setting also applies to its dropdown. The controls update automatically when the user changes the Windows theme.

What Is Themed

  • The SFTDATE_BORDER_FIXED3D border of a field, which shows whether the mouse is over the field, whether it has the input focus and whether it is disabled. The SFTDATE_BORDER_FIXEDSINGLE border is a line drawn by the control.
  • The up and down buttons, the dropdown button and the check box of a field.
  • In a calendar, the selected day, today's date, the day under the mouse and the previous and next buttons.

Colors

The calendar uses the theme only with the default colors of its background, its selection, the day under the mouse and today's date. Setting one of the SFTDATE_COLOR_BACK, SFTDATE_COLOR_SELECTEDBACK, SFTDATE_COLOR_HOTBACK or SFTDATE_COLOR_TODAY colors draws the calendar without the theme (see Colors). The field's colors can be set with or without the theme.

Dark Mode and High Contrast

Windows has no dark version of the calendar's theme, so a calendar is drawn in its built-in style while dark mode is active. The field's border, buttons and check box use the dark variants of the Windows themes (see Dark Mode). With Windows High Contrast, the controls are drawn without themes, in the colors of the user's contrast theme (see High Contrast).

Testing

To prepare an application for proper themes support, the controls should be viewed both with and without Windows themes (using SftDate_SetUseThemes), to make sure that they are visually satisfactory in both cases.


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