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. SftTree/NET 3.0 follows this rule when high contrast mode is active.

When high contrast mode is active, the tree control:

  • uses the system colors of the user's contrast theme for all its elements: SystemColors.Window and SystemColors.WindowText for items, SystemColors.Highlight and SystemColors.HighlightText for selected items, SystemColors.Control and SystemColors.ControlText for column headers, column footers and row headers, and similar for other elements,
  • ignores colors set by the application for the control, its columns, items, cells and parts - the user's contrast theme wins,
  • draws column headers, column footers, row headers, buttons, checkboxes, radio buttons and progress bars without Windows themes,
  • shows selected items using the highlight colors, regardless of the SelectionOutlineStyle property.

The HighContrastMode property has three values (see HighContrastModeEnum):

ValueDescription
HighContrastModeEnum.AutoFollow the Windows contrast theme setting. The control switches when the setting changes.
HighContrastModeEnum.OnAlways use the system colors, regardless of the Windows setting. Useful for testing.
HighContrastModeEnum.Off (default)Ignore the Windows contrast theme setting and draw normally. Not recommended in shipping applications - users with accessibility needs will see colors that do not follow their contrast theme.

The HighContrastChanged event occurs each time the control switches between its own colors and the colors of the contrast theme, so the application can update its own colors around the tree control. The HighContrastActive property returns the current state at any time.

Images, such as item images, images in cells and background images, are drawn as defined. Make sure that the images used in the tree control remain visible with the user's contrast theme colors.

Dark mode and Windows High Contrast are independent settings. If both are active, high contrast takes precedence, because honoring the user's contrast theme is the stronger accessibility requirement. See Dark Mode.