Skip to content

Commit eb3d83c

Browse files
author
Mirroring
committed
Merge commit 'cac0d2665c0b0474a10a3f06400a345705c3e64b'
2 parents dfabaed + cac0d26 commit eb3d83c

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/System.Windows.Forms/src/System/Windows/Forms/DataGridViewButtonCell.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -909,7 +909,7 @@ private Rectangle PaintPrivate(
909909
// Draw focus rectangle
910910
if (FlatStyle == FlatStyle.System || FlatStyle == FlatStyle.Standard)
911911
{
912-
ControlPaint.DrawFocusRectangle(g, Rectangle.Inflate(valBounds, -1, -1), Color.Empty, SystemColors.Control);
912+
ControlPaint.DrawFocusRectangle(g, Rectangle.Inflate(valBounds, -1, -1), Color.Empty, cellStyle.ForeColor);
913913
}
914914
else if (FlatStyle == FlatStyle.Flat)
915915
{
@@ -972,8 +972,8 @@ private Rectangle PaintPrivate(
972972
ControlPaint.DrawFocusRectangle(
973973
g,
974974
layout.Focus,
975-
cellStyle.ForeColor,
976-
cellStyle.BackColor);
975+
Color.Empty,
976+
cellStyle.ForeColor);
977977
}
978978
}
979979
}

src/System.Windows.Forms/src/System/Windows/Forms/DataGridViewCheckBoxCell.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1230,7 +1230,7 @@ private Rectangle PaintPrivate(Graphics g,
12301230
ptCurrentCell.Y == rowIndex)
12311231
{
12321232
// Draw focus rectangle
1233-
ControlPaint.DrawFocusRectangle(g, valBounds, Color.Empty, brushColor);
1233+
ControlPaint.DrawFocusRectangle(g, valBounds, cellStyle.BackColor, cellStyle.ForeColor);
12341234
}
12351235

12361236
Rectangle errorBounds = valBounds;

src/System.Windows.Forms/src/System/Windows/Forms/DataGridViewComboBoxCell.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2364,7 +2364,7 @@ private Rectangle PaintPrivate(Graphics g,
23642364
focusBounds.Width++;
23652365
focusBounds.Y--;
23662366
focusBounds.Height += 2;
2367-
ControlPaint.DrawFocusRectangle(g, focusBounds, Color.Empty, brushColor);
2367+
ControlPaint.DrawFocusRectangle(g, focusBounds, Color.Empty, cellStyle.ForeColor);
23682368
}
23692369
else if (paintPostXPThemes)
23702370
{
@@ -2375,12 +2375,12 @@ private Rectangle PaintPrivate(Graphics g,
23752375
focusBounds.Height -= 2;
23762376
if (focusBounds.Width > 0 && focusBounds.Height > 0)
23772377
{
2378-
ControlPaint.DrawFocusRectangle(g, focusBounds, Color.Empty, brushColor);
2378+
ControlPaint.DrawFocusRectangle(g, focusBounds, Color.Empty, cellStyle.ForeColor);
23792379
}
23802380
}
23812381
else
23822382
{
2383-
ControlPaint.DrawFocusRectangle(g, textBounds, Color.Empty, brushColor);
2383+
ControlPaint.DrawFocusRectangle(g, textBounds, Color.Empty, cellStyle.ForeColor);
23842384
}
23852385
}
23862386

src/System.Windows.Forms/src/System/Windows/Forms/DataGridViewTextBoxCell.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ private Rectangle PaintPrivate(Graphics graphics,
700700
// Draw focus rectangle
701701
if (PaintFocus(paintParts) && DataGridView.ShowFocusCues && DataGridView.Focused && notCollapsed)
702702
{
703-
ControlPaint.DrawFocusRectangle(graphics, valBounds, Color.Empty, brushColor);
703+
ControlPaint.DrawFocusRectangle(graphics, valBounds, Color.Empty, cellStyle.ForeColor);
704704
}
705705
}
706706

0 commit comments

Comments
 (0)