Closed
Labels
waiting-reviewThis item is waiting on review by one or more members of team
Milestone
Description
.NET version
.NET 11 (and every shipped release back to the initial WinForms source import in commit 195f89af7).
Did it work in .NET Framework?
Not tested/verified
Did it work in any of the earlier releases of .NET Core or .NET 5+?
No. The line was added in the initial WinForms source import (195f89af7, "Added System.Windows.Forms source") and has not been modified since (only a path move in 17fd2a33ec).
Issue description
PropertyGrid.ResetHelpForeColor calls _helpPane.ResetBackColor() instead of _helpPane.ResetForeColor():
// src/System.Windows.Forms/System/Windows/Forms/Controls/PropertyGrid/PropertyGrid.cs:3631
private void ResetHelpForeColor() => _helpPane.ResetBackColor();Steps to reproduce
Direct invocation (no public-API repro exists):
using PropertyGrid grid = new();
grid.HelpForeColor = Color.Red;
grid.HelpBackColor = Color.Yellow;
grid.TestAccessor.Dynamic.ResetHelpForeColor();
// Expected: HelpForeColor == SystemColors.ControlText, HelpBackColor == Color.Yellow
// Actual: HelpForeColor == Color.Red, HelpBackColor == SystemColors.ControlMetadata
Metadata
Assignees
Labels
waiting-reviewThis item is waiting on review by one or more members of team
Activity
Fixes PropertyGrid.ResetHelpForeColor resets the back color instead o…
Zheng-Li01 commentedon Jul 3, 2026
Tested in the latest .NET 11 Preview 7 build: 11.0.100-preview.7.26352.103 + built private dls from the main branch of Winforms repo, it was fixed as below screenshot.
WinFormsApp46.zip
Amy-Li03 commentedon Aug 3, 2026
Hi @ricardobossan ,
ResetHelpForeColor() successfully restores the default help text color on the first invocation. However, after changing the parent form's ForeColor, the PropertyGrid.HelpForeColor is updated accordingly.
Subsequent calls to ResetHelpForeColor() do not restore the original default color. Instead, the current inherited color appears to be treated as the default value.
It is unclear whether HelpForeColor is intended to track changes to the parent form's ForeColor, or whether the reset behavior is incorrect in this scenario.
ricardobossan commentedon Aug 4, 2026
Thanks for testing this further, @Amy-Li03 .
This part is expected behavior, not a bug:
HelpForeColor/ResetHelpForeColor()are a thin wrapper over the internal help pane'sForeColor/ResetForeColor(), andControl.ForeColoris documented as an ambient property.ResetForeColor()doesn't restore a fixed original value, it clears any explicit override so the control goes back to tracking its parent's color. Once you change the parent form'sForeColor, the help pane (still in the "not explicitly set" state after the first reset) picks up that new value automatically, and a secondResetHelpForeColor()has nothing left to reset since it's already tracking the ambient value.You can see the same thing with any plain control, e.g. a
Labelon the same form:label.ResetForeColor(), then change the form'sForeColor, thenlabel.ResetForeColor()again; same result. So this isn't specific toHelpForeColoror related to the fix in #14572, which only correctedResetHelpForeColorcalling the wrong internal method (ResetBackColorinstead ofResetForeColor) and didn't touch the ambient-reset semantics at all.Amy-Li03 commentedon Aug 5, 2026
@ricardobossan
Thanks for the clarification. I tested the same scenario with a regular Label and observed identical behavior after calling ResetForeColor(). Your explanation about ambient property inheritance makes sense: ResetForeColor() does not restore a fixed original value, but instead clears any explicit override and returns the control to its ambient state. As a result, the control resumes tracking its parent's ForeColor, so later changes to the parent are reflected automatically, and subsequent calls to ResetForeColor() have nothing left to reset.