Returns whether dark mode colors are currently in use.
Class: SoftelvdmUserControl
Namespace: Softelvdm.SftTabsNET.Controls
Assembly: Softelvdm.SftTabsNET
public bool DarkModeActive { get; }
Public ReadOnly Property DarkModeActive As BooleanTrue if dark mode colors are in use, False otherwise.
Returns whether dark mode colors are currently in use.
The value is derived from the DarkMode property and, for DarkModeEnum.Auto, the Windows app mode setting.
}
private void sftTabs1_DarkModeChanged(object sender, EventArgs e) {
SetPageColors();
}
// the control paints the pages; the text color of the controls on the pages is the application's
private void SetPageColors() {
Color color = sftTabs1.DarkModeActive ? Color.White : SystemColors.ControlText;
foreach (TabClass tab in sftTabs1.Tabs)
tab.Page.ForeColor = color;
}
private void sftTabs1_TabCloseButtonClicked(object sender, TabEventArgs e) {
// the control does not remove the tab, the application does
tabImages.Remove(e.Tab);End Sub Private Sub SftTabs1_DarkModeChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SftTabs1.DarkModeChanged SetPageColors() End Sub ' the control paints the pages; the text color of the controls on the pages is the application's Private Sub SetPageColors() Dim fore As Color = If(SftTabs1.DarkModeActive, Color.White, SystemColors.ControlText) For Each tab As TabClass In SftTabs1.Tabs tab.Page.ForeColor = fore Next End Sub Private Sub SftTabs1_TabCloseButtonClicked(ByVal sender As System.Object, ByVal e As Softelvdm.SftTabsNET.TabEventArgs) Handles SftTabs1.TabCloseButtonClicked ' the control does not remove the tab, the application does
See Also SoftelvdmUserControl Class | Classes | SftTabs/NET 3.0