From 83e704dbbd10c61a437e94d578bc4794d2692328 Mon Sep 17 00:00:00 2001 From: AsY!um- <377468+AsYlum-@users.noreply.github.com> Date: Mon, 16 Nov 2026 21:44:08 +0100 Subject: [PATCH] Fix tab styling in multis control. --- UoFiddler.Controls/UserControls/MultisControl.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/UoFiddler.Controls/UserControls/MultisControl.cs b/UoFiddler.Controls/UserControls/MultisControl.cs index 41225114..776abe58 100644 --- a/UoFiddler.Controls/UserControls/MultisControl.cs +++ b/UoFiddler.Controls/UserControls/MultisControl.cs @@ -37,6 +37,8 @@ public MultisControl() SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.UserPaint, true); _refMarker = this; + ApplyDarkModeIfNeeded(); + if (!File.Exists(_multiXmlFileName)) { return; @@ -221,6 +223,11 @@ private void ApplyDarkModeIfNeeded() tp.UseVisualStyleBackColor = false; tp.BackColor = tabBg; } + + // WinForms dark mode draws a nested TabControl's headers light when its handle is + // created along with the form; created after load (like the uop one) it is dark. + // OnLoad shows it again. + tabControl3.Visible = false; } ApplyPreviewBackgroundColor(); @@ -240,7 +247,10 @@ private void OnLoad(object sender, EventArgs e) return; } - ApplyDarkModeIfNeeded(); + if (!tabControl3.Visible) + { + BeginInvoke(() => tabControl3.Visible = true); + } using (new WaitCursorScope(this)) {