diff --git a/src/System.Windows.Forms/System/Windows/Forms/Controls/ToolStrips/ToolStripLabel.cs b/src/System.Windows.Forms/System/Windows/Forms/Controls/ToolStrips/ToolStripLabel.cs index aaee3062e40..f750df295f2 100644 --- a/src/System.Windows.Forms/System/Windows/Forms/Controls/ToolStrips/ToolStripLabel.cs +++ b/src/System.Windows.Forms/System/Windows/Forms/Controls/ToolStrips/ToolStripLabel.cs @@ -351,6 +351,7 @@ internal void PaintText(Graphics g) { Font font = Font; Color textColor = ForeColor; + Rectangle textRect = InternalLayout.TextRectangle; if (IsLink) { LinkUtilities.EnsureLinkFonts(font, LinkBehavior, ref _linkFont, ref _hoverLinkFont); @@ -359,11 +360,19 @@ internal void PaintText(Graphics g) { font = _hoverLinkFont; textColor = ActiveLinkColor; + if (DisplayInformation.HighContrast) + { + g.FillRectangle(SystemBrushes.Highlight, textRect); + } } else if (Selected) { font = _hoverLinkFont; textColor = (LinkVisited) ? VisitedLinkColor : LinkColor; + if (DisplayInformation.HighContrast) + { + g.FillRectangle(SystemBrushes.Highlight, textRect); + } } else { @@ -372,7 +381,6 @@ internal void PaintText(Graphics g) } } - Rectangle textRect = InternalLayout.TextRectangle; renderer.DrawItemText(new ToolStripItemTextRenderEventArgs(g, this, Text, textRect, textColor, font, InternalLayout.TextFormat)); } }