Returns whether dark mode is in effect.
Class: SftStyle
Namespace: Softelvdm.SftStyleNET
Assembly: Softelvdm.SftStyleNET
public bool DarkModeActive { get; }
Public ReadOnly Property DarkModeActive As BooleanTrue if dark mode is in effect from SftStyle.DarkMode and, with DarkModeEnum.Auto, the Windows setting, False otherwise. While SftStyle.HighContrastActive is True the forms are not styled in dark mode, even if this property is True.
Returns whether dark mode is in effect.
}
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) {
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.RangeChangedSee Also SftStyle Class | Classes | SftStyle/NET 3.0