Skip to content
Open
Show file tree
Hide file tree
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 @@ -3628,7 +3628,7 @@ internal void RemoveTab(Type tabType)

private void ResetHelpBackColor() => _helpPane.ResetBackColor();

private void ResetHelpForeColor() => _helpPane.ResetBackColor();
private void ResetHelpForeColor() => _helpPane.ResetForeColor();

/// <summary>
/// This method is intended for use in replacing a specific selected root object with another object of the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1972,6 +1972,36 @@ public void PropertyGrid_HelpForeColor_ShouldSerializeValue_Success()
Assert.False(property.ShouldSerializeValue(control));
}

[WinFormsFact]
public void PropertyGrid_ResetHelpForeColor_Invoke_ResetsForeColorOnly()
{
using PropertyGrid control = new()
{
HelpForeColor = Color.Red,
HelpBackColor = Color.Yellow
};

control.TestAccessor.Dynamic.ResetHelpForeColor();

Assert.Equal(SystemColors.ControlText, control.HelpForeColor);
Assert.Equal(Color.Yellow, control.HelpBackColor);
}

[WinFormsFact]
public void PropertyGrid_ResetHelpBackColor_Invoke_ResetsBackColorOnly()
{
using PropertyGrid control = new()
{
HelpForeColor = Color.Red,
HelpBackColor = Color.Yellow
};

control.TestAccessor.Dynamic.ResetHelpBackColor();

Assert.Equal(SystemColors.Control, control.HelpBackColor);
Assert.Equal(Color.Red, control.HelpForeColor);
}

[WinFormsTheory]
[InlineData(true, true, 0, 0, 1)]
[InlineData(true, false, 1, 1, 2)]
Expand Down
Loading