Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1790,9 +1790,19 @@ private bool ShouldSerializeItemSize()
return !_padding.Equals(s_defaultPaddingPoint);
}

private BOOL StyleChildren(HWND handle) =>
PInvoke.SetWindowTheme(handle, $"{DarkModeIdentifier}_{ExplorerThemeIdentifier}", null)
.Succeeded;
private BOOL StyleChildren(HWND handle)
{
// Only apply theme to direct children (TabPages), not to controls within TabPages.
// Controls like ComboBox need their own specific dark mode themes.
HWND parent = PInvoke.GetParent(handle);
if (parent == HWND)
{
return PInvoke.SetWindowTheme(handle, $"{DarkModeIdentifier}_{ExplorerThemeIdentifier}", null)
.Succeeded;
}

return true;
}

/// <summary>
/// Returns a string representation for this control.
Expand Down