HeaderPane
Main
Hide
Share Link
Print

HighContrastActive Property, SftStyle Class

Returns whether high contrast is in effect.

Class: SftStyle
Namespace: Softelvdm.SftStyleNET
Assembly: Softelvdm.SftStyleNET

Syntax

public bool HighContrastActive { get; }
Public ReadOnly Property HighContrastActive As Boolean

Value

True if high contrast is in effect from SftStyle.HighContrastMode and, with HighContrastModeEnum.Auto, the Windows contrast theme setting, False otherwise.

Comments

Returns whether high contrast is in effect.

Examples

C# View entire sample code

        }

        private void sftStyle1_HighContrastChanged(object sender, EventArgs e) {
            ShowState();
        }

        // With Auto, the component follows the Windows settings, also when they change while the form is open.
        private void ShowState() {
            labelState.Text = "Dark mode is " + (sftStyle1.DarkModeActive ? "on" : "off") + ", high contrast is " + (sftStyle1.HighContrastActive ? "on" : "off") + ".";
        }

        private void sliderVolume_ValueChanged(object sender, EventArgs e) {
            ShowSliders();
        }

        private void sliderPrice_RangeChanged(object sender, EventArgs e) {

VB.NET View entire sample code

    End Sub

    Private Sub SftStyle1_HighContrastChanged(ByVal sender As Object, ByVal e As EventArgs) Handles SftStyle1.HighContrastChanged
        ShowState()
    End Sub

    ' With Auto, the component follows the Windows settings, also when they change while the form is open.
    Private Sub ShowState()
        LabelState.Text = "Dark mode is " + If(SftStyle1.DarkModeActive, "on", "off") + ", high contrast is " + If(SftStyle1.HighContrastActive, "on", "off") + "."
    End Sub

    Private Sub SliderVolume_ValueChanged(ByVal sender As Object, ByVal e As EventArgs) Handles SliderVolume.ValueChanged
        ShowSliders()
    End Sub

    Private Sub SliderPrice_RangeChanged(ByVal sender As Object, ByVal e As EventArgs) Handles SliderPrice.RangeChanged

See Also SftStyle Class | Classes | SftStyle/NET 3.0