HeaderPane
Main
Hide
Share Link
Print

HighContrastMode Property, SoftelvdmUserControl Class

Defines whether the control uses the colors of the Windows contrast theme.

Class: SoftelvdmUserControl
Namespace: Softelvdm.SftDateNET.Controls
Assembly: Softelvdm.SftDateNET

Syntax

public HighContrastModeEnum HighContrastMode { get; set; }
Public Property HighContrastMode As HighContrastModeEnum

Value

The high contrast setting.

The default value is HighContrastModeEnum.Off.

Comments

Defines whether the control uses the colors of the Windows contrast theme.

In high contrast mode, the control draws all its elements using the system colors of the user's contrast theme. Colors defined by the application for the control, its calendar and its special dates are ignored.

With HighContrastModeEnum.Auto, the control follows the Windows contrast theme setting (Settings, Accessibility, Contrast themes) and switches when that setting changes. The SoftelvdmUserControl.HighContrastActive property returns the resulting state.

High contrast mode takes precedence over dark mode.

Examples

C# View entire sample code

                "Japanese (Japan), Japanese calendar",
                "Arabic (Saudi Arabia), Hijri calendar",
                "Hebrew (Israel), Hebrew calendar",
                "Thai (Thailand), Buddhist calendar",
                "Persian (Iran), Persian calendar",
            });
            comboCulture.SelectedIndex = 0;
            FillCombo(comboDarkMode, typeof(DarkModeEnum), sftCalendar1.DarkMode);
            FillCombo(comboHighContrast, typeof(HighContrastModeEnum), sftCalendar1.HighContrastMode);
            FillCombo(comboButtons, typeof(FieldButtonsEnum), sftDate1.Buttons);
            comboWeekNumbers.Items.AddRange(new object[] { "None", "Culture rule", "ISO 8601" });
            comboWeekNumbers.SelectedIndex = 0;
            FillCombo(comboFirstDay, typeof(FirstDayOfWeekEnum), sftCalendar1.Calendar.FirstDayOfWeek);
            ShowSelection();
        }

VB.NET View entire sample code

            "French (France)",
            "Japanese (Japan), Japanese calendar",
            "Arabic (Saudi Arabia), Hijri calendar",
            "Hebrew (Israel), Hebrew calendar",
            "Thai (Thailand), Buddhist calendar",
            "Persian (Iran), Persian calendar"})
        ComboCulture.SelectedIndex = 0
        FillCombo(ComboDarkMode, GetType(DarkModeEnum), SftCalendar1.DarkMode)
        FillCombo(ComboHighContrast, GetType(HighContrastModeEnum), SftCalendar1.HighContrastMode)
        FillCombo(ComboButtons, GetType(FieldButtonsEnum), SftDate1.Buttons)
        ComboWeekNumbers.Items.AddRange(New Object() {"None", "Culture rule", "ISO 8601"})
        ComboWeekNumbers.SelectedIndex = 0
        FillCombo(ComboFirstDay, GetType(FirstDayOfWeekEnum), SftCalendar1.Calendar.FirstDayOfWeek)
        ShowSelection()
    End Sub

See Also SoftelvdmUserControl Class | Classes | SftDate/NET 3.0