diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/DataGridViewButtonCell.cs b/src/System.Windows.Forms/src/System/Windows/Forms/DataGridViewButtonCell.cs index ab8286119cf..9f5ee7b3ec6 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/DataGridViewButtonCell.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/DataGridViewButtonCell.cs @@ -909,7 +909,7 @@ private Rectangle PaintPrivate( // Draw focus rectangle if (FlatStyle == FlatStyle.System || FlatStyle == FlatStyle.Standard) { - ControlPaint.DrawFocusRectangle(g, Rectangle.Inflate(valBounds, -1, -1), Color.Empty, SystemColors.Control); + ControlPaint.DrawFocusRectangle(g, Rectangle.Inflate(valBounds, -1, -1), Color.Empty, cellStyle.ForeColor); } else if (FlatStyle == FlatStyle.Flat) { @@ -972,8 +972,8 @@ private Rectangle PaintPrivate( ControlPaint.DrawFocusRectangle( g, layout.Focus, - cellStyle.ForeColor, - cellStyle.BackColor); + Color.Empty, + cellStyle.ForeColor); } } } diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/DataGridViewCheckBoxCell.cs b/src/System.Windows.Forms/src/System/Windows/Forms/DataGridViewCheckBoxCell.cs index 40959ac1036..4da7146e03b 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/DataGridViewCheckBoxCell.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/DataGridViewCheckBoxCell.cs @@ -1230,7 +1230,7 @@ private Rectangle PaintPrivate(Graphics g, ptCurrentCell.Y == rowIndex) { // Draw focus rectangle - ControlPaint.DrawFocusRectangle(g, valBounds, Color.Empty, brushColor); + ControlPaint.DrawFocusRectangle(g, valBounds, cellStyle.BackColor, cellStyle.ForeColor); } Rectangle errorBounds = valBounds; diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/DataGridViewComboBoxCell.cs b/src/System.Windows.Forms/src/System/Windows/Forms/DataGridViewComboBoxCell.cs index 95fad6f67b9..25737cd4f0b 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/DataGridViewComboBoxCell.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/DataGridViewComboBoxCell.cs @@ -2364,7 +2364,7 @@ private Rectangle PaintPrivate(Graphics g, focusBounds.Width++; focusBounds.Y--; focusBounds.Height += 2; - ControlPaint.DrawFocusRectangle(g, focusBounds, Color.Empty, brushColor); + ControlPaint.DrawFocusRectangle(g, focusBounds, Color.Empty, cellStyle.ForeColor); } else if (paintPostXPThemes) { @@ -2375,12 +2375,12 @@ private Rectangle PaintPrivate(Graphics g, focusBounds.Height -= 2; if (focusBounds.Width > 0 && focusBounds.Height > 0) { - ControlPaint.DrawFocusRectangle(g, focusBounds, Color.Empty, brushColor); + ControlPaint.DrawFocusRectangle(g, focusBounds, Color.Empty, cellStyle.ForeColor); } } else { - ControlPaint.DrawFocusRectangle(g, textBounds, Color.Empty, brushColor); + ControlPaint.DrawFocusRectangle(g, textBounds, Color.Empty, cellStyle.ForeColor); } } diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/DataGridViewTextBoxCell.cs b/src/System.Windows.Forms/src/System/Windows/Forms/DataGridViewTextBoxCell.cs index e5579ee1ff9..8118fda293a 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/DataGridViewTextBoxCell.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/DataGridViewTextBoxCell.cs @@ -700,7 +700,7 @@ private Rectangle PaintPrivate(Graphics graphics, // Draw focus rectangle if (PaintFocus(paintParts) && DataGridView.ShowFocusCues && DataGridView.Focused && notCollapsed) { - ControlPaint.DrawFocusRectangle(graphics, valBounds, Color.Empty, brushColor); + ControlPaint.DrawFocusRectangle(graphics, valBounds, Color.Empty, cellStyle.ForeColor); } }