diff --git a/src/System.Windows.Forms/System/Windows/Forms/Controls/DataGridView/DataGridView.cs b/src/System.Windows.Forms/System/Windows/Forms/Controls/DataGridView/DataGridView.cs index 75a47694c6d..1212f20b5b4 100644 --- a/src/System.Windows.Forms/System/Windows/Forms/Controls/DataGridView/DataGridView.cs +++ b/src/System.Windows.Forms/System/Windows/Forms/Controls/DataGridView/DataGridView.cs @@ -2061,7 +2061,9 @@ private DataGridViewCellStyle DefaultDefaultCellStyle BackColor = s_defaultBackColor, ForeColor = SystemInformation.HighContrast ? DefaultForeBrush.Color : base.ForeColor, SelectionBackColor = DefaultSelectionBackBrush.Color, - SelectionForeColor = DefaultSelectionForeBrush.Color, +#pragma warning disable WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. + SelectionForeColor = Application.IsDarkModeEnabled ? SystemColors.ControlText : DefaultSelectionForeBrush.Color, +#pragma warning restore WFO5001 Font = base.Font, AlignmentInternal = DataGridViewContentAlignment.MiddleLeft, WrapModeInternal = DataGridViewTriState.False