68 writes to BackColor
System.Windows.Forms (31)
System\Windows\Forms\Controls\DataGridView\DataGridView.cs (4)
1541
BackColor
= DefaultHeadersBackBrush.Color,
1986
defaultCellStyleTmp.
BackColor
= s_defaultBackColor;
2054
BackColor
= s_defaultBackColor,
2091
BackColor
= DefaultHeadersBackBrush.Color,
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (3)
2809
inheritedCellStyle.
BackColor
= cellStyle.BackColor;
2813
inheritedCellStyle.
BackColor
= columnHeadersStyle.BackColor;
2817
inheritedCellStyle.
BackColor
= dataGridViewStyle.BackColor;
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (7)
1893
inheritedCellStyleTmp.
BackColor
= Color.Empty;
1932
inheritedCellStyleTmp.
BackColor
= cellStyle.BackColor;
1936
inheritedCellStyleTmp.
BackColor
= rowStyle.BackColor;
1941
inheritedCellStyleTmp.
BackColor
= DataGridView.RowsDefaultCellStyle.BackColor;
1945
inheritedCellStyleTmp.
BackColor
= DataGridView.AlternatingRowsDefaultCellStyle.BackColor;
1949
inheritedCellStyleTmp.
BackColor
= columnStyle.BackColor;
1953
inheritedCellStyleTmp.
BackColor
= dataGridViewStyle.BackColor;
System\Windows\Forms\Controls\DataGridView\DataGridViewCellStyle.cs (2)
45
BackColor
= dataGridViewCellStyle.BackColor;
380
BackColor
= dataGridViewCellStyle.BackColor;
System\Windows\Forms\Controls\DataGridView\DataGridViewColumn.cs (2)
447
inheritedCellStyleTmp.
BackColor
= columnStyle.BackColor;
451
inheritedCellStyleTmp.
BackColor
= dataGridViewStyle.BackColor;
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnHeaderCell.cs (3)
303
inheritedCellStyleTmp.
BackColor
= cellStyle.BackColor;
307
inheritedCellStyleTmp.
BackColor
= columnHeadersStyle.BackColor;
311
inheritedCellStyleTmp.
BackColor
= dataGridViewStyle.BackColor;
System\Windows\Forms\Controls\DataGridView\DataGridViewRow.cs (7)
617
inheritedCellStyle.
BackColor
= cellStyle.BackColor;
621
inheritedCellStyle.
BackColor
= rowHeadersStyle.BackColor;
625
inheritedCellStyle.
BackColor
= dataGridViewStyle.BackColor;
815
inheritedRowStyle.
BackColor
= rowStyle.BackColor;
819
inheritedRowStyle.
BackColor
= rowsDefaultCellStyle.BackColor;
823
inheritedRowStyle.
BackColor
= alternatingRowsDefaultCellStyle.BackColor;
827
inheritedRowStyle.
BackColor
= dataGridViewStyle.BackColor;
System\Windows\Forms\Controls\DataGridView\DataGridViewRowHeaderCell.cs (3)
328
inheritedCellStyleTmp.
BackColor
= cellStyle.BackColor;
332
inheritedCellStyleTmp.
BackColor
= rowHeadersStyle.BackColor;
336
inheritedCellStyleTmp.
BackColor
= dataGridViewStyle.BackColor;
System.Windows.Forms.Design (1)
System\Windows\Forms\Design\DataGridViewColumnCollectionDialog.cs (1)
375
destColumn.DefaultCellStyle.
BackColor
= srcColumn.DefaultCellStyle.BackColor;
System.Windows.Forms.Design.Tests (1)
System\Windows\Forms\Design\DataGridViewCellStyleBuilderTests.cs (1)
19
builder.CellStyle = new DataGridViewCellStyle {
BackColor
= Color.Red };
System.Windows.Forms.Tests (33)
System\Windows\Forms\DataGridViewButtonColumnTests.cs (1)
195
_column.DefaultCellStyle.
BackColor
= Color.Red;
System\Windows\Forms\DataGridViewCellStyleTests.cs (15)
45
BackColor
= Color.Red,
139
BackColor
= value
144
style.
BackColor
= value;
153
BackColor
= Color.Red
155
style.
BackColor
= Color.Empty;
622
BackColor
= Color.Red,
665
BackColor
= Color.Red,
713
BackColor
= Color.Red,
779
BackColor
= Color.Red,
859
new DataGridViewCellStyle {
BackColor
= Color.Red },
860
new DataGridViewCellStyle {
BackColor
= Color.Red },
865
new DataGridViewCellStyle {
BackColor
= Color.Red },
866
new DataGridViewCellStyle {
BackColor
= Color.Blue },
1052
new DataGridViewCellStyle {
BackColor
= Color.Red },
1127
BackColor
= Color.Red,
System\Windows\Forms\DataGridViewRowTests.cs (6)
2066
BackColor
= Color.Green,
2082
BackColor
= Color.Blue,
4188
yield return new object[] { new Rectangle(1, 2, 3, 4), new Rectangle(1, 2, 3, 4), 1, DataGridViewElementStates.Selected, new DataGridViewCellStyle {
BackColor
= Color.Blue, SelectionBackColor = Color.Red }, true };
4189
yield return new object[] { new Rectangle(1, 2, 3, 4), new Rectangle(1, 2, 3, 4), 1, DataGridViewElementStates.Selected, new DataGridViewCellStyle {
BackColor
= Color.Blue, SelectionBackColor = Color.Red }, true };
4190
yield return new object[] { new Rectangle(1, 2, 3, 4), new Rectangle(1, 2, 3, 4), 1, DataGridViewElementStates.None, new DataGridViewCellStyle {
BackColor
= Color.Blue, SelectionBackColor = Color.Red }, true };
4191
yield return new object[] { new Rectangle(1, 2, 3, 4), new Rectangle(1, 2, 3, 4), 1, DataGridViewElementStates.None, new DataGridViewCellStyle {
BackColor
= Color.Blue, SelectionBackColor = Color.Red }, false };
System\Windows\Forms\DataGridViewTests.cs (6)
795
yield return new object[] { new DataGridViewCellStyle {
BackColor
= Color.Empty } };
2340
BackColor
= SystemColors.Info,
3049
_dataGridView.AlternatingRowsDefaultCellStyle = new() {
BackColor
= Color.AliceBlue };
3169
_dataGridView.ColumnHeadersDefaultCellStyle = new() {
BackColor
= Color.Red };
3229
_dataGridView.DefaultCellStyle = new() {
BackColor
= Color.Red };
3369
_dataGridView.RowsDefaultCellStyle = new() {
BackColor
= Color.Red };
System\Windows\Forms\DataGridViewTests.Rendering.cs (1)
125
BackColor
= SystemColors.Info,
System\Windows\Forms\DataGridViewTextBoxEditingControlTests.cs (4)
554
BackColor
= Color.Gray,
562
BackColor
= Color.FromArgb(0x12, 0x34, 0x56, 0x78),
763
BackColor
= Color.Gray,
771
BackColor
= Color.FromArgb(0x12, 0x34, 0x56, 0x78),
WinFormsControlsTest (2)
DataGridViewTest.Designer.cs (2)
57
dataGridViewCellStyle1.
BackColor
= System.Drawing.SystemColors.Control;
75
dataGridViewCellStyle3.
BackColor
= System.Drawing.SystemColors.Info;
110 references to BackColor
PresentationUI (2)
MS\Internal\Documents\RMPublishingDialog.RightsTable.cs (2)
481
BackgroundColor = DefaultCellStyle.
BackColor
;
1016
(this.Selected) ? cellStyle.SelectionBackColor : cellStyle.
BackColor
);
System.Windows.Forms (92)
System\Windows\Forms\Controls\DataGridView\DataGridView.cs (2)
1972
else if (_defaultCellStyle.
BackColor
== Color.Empty
1984
if (_defaultCellStyle.
BackColor
== Color.Empty)
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (6)
2701
_editingPanel.BackColor = dgvese.CellStyle.
BackColor
;
2807
if (cellStyle is not null && !cellStyle.
BackColor
.IsEmpty)
2809
inheritedCellStyle.BackColor = cellStyle.
BackColor
;
2811
else if (!columnHeadersStyle.
BackColor
.IsEmpty)
2813
inheritedCellStyle.BackColor = columnHeadersStyle.
BackColor
;
2817
inheritedCellStyle.BackColor = dataGridViewStyle.
BackColor
;
System\Windows\Forms\Controls\DataGridView\DataGridViewButtonCell.cs (6)
667
: cellStyle.
BackColor
;
773
cellStyle.
BackColor
,
805
cellStyle.
BackColor
,
826
cellStyle.
BackColor
,
841
cellStyle.
BackColor
,
897
cellStyle.
BackColor
,
System\Windows\Forms\Controls\DataGridView\DataGridViewButtonColumn.cs (1)
214
return (!defaultCellStyle.
BackColor
.IsEmpty ||
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (14)
1930
if (cellStyle is not null && !cellStyle.
BackColor
.IsEmpty)
1932
inheritedCellStyleTmp.BackColor = cellStyle.
BackColor
;
1934
else if (rowStyle is not null && !rowStyle.
BackColor
.IsEmpty)
1936
inheritedCellStyleTmp.BackColor = rowStyle.
BackColor
;
1938
else if (!DataGridView.RowsDefaultCellStyle.
BackColor
.IsEmpty &&
1939
(rowIndex % 2 == 0 || DataGridView.AlternatingRowsDefaultCellStyle.
BackColor
.IsEmpty))
1941
inheritedCellStyleTmp.BackColor = DataGridView.RowsDefaultCellStyle.
BackColor
;
1943
else if (rowIndex % 2 == 1 && !DataGridView.AlternatingRowsDefaultCellStyle.
BackColor
.IsEmpty)
1945
inheritedCellStyleTmp.BackColor = DataGridView.AlternatingRowsDefaultCellStyle.
BackColor
;
1947
else if (columnStyle is not null && !columnStyle.
BackColor
.IsEmpty)
1949
inheritedCellStyleTmp.BackColor = columnStyle.
BackColor
;
1953
inheritedCellStyleTmp.BackColor = dataGridViewStyle.
BackColor
;
3139
using var penBackColor = cellStyle.
BackColor
.GetCachedPenScope();
3142
(Color darkColor, Color lightColor) = GetContrastedColors(cellStyle.
BackColor
);
System\Windows\Forms\Controls\DataGridView\DataGridViewCellStyle.cs (8)
45
BackColor = dataGridViewCellStyle.
BackColor
;
378
if (!dataGridViewCellStyle.
BackColor
.IsEmpty)
380
BackColor = dataGridViewCellStyle.
BackColor
;
465
dgvcs.
BackColor
!=
BackColor
||
491
hash.Add(
BackColor
);
538
if (
BackColor
!= Color.Empty)
540
sb.Append($" BackColor={
BackColor
}");
System\Windows\Forms\Controls\DataGridView\DataGridViewCheckBoxCell.cs (6)
1120
: cellStyle.
BackColor
;
1151
ControlPaint.DrawFocusRectangle(g, valBounds, cellStyle.
BackColor
, cellStyle.ForeColor);
1297
: cellStyle.
BackColor
;
1420
cellStyle.
BackColor
,
1469
cellStyle.
BackColor
,
1516
cellStyle.
BackColor
,
System\Windows\Forms\Controls\DataGridView\DataGridViewCheckBoxColumn.cs (1)
300
return (!defaultCellStyle.
BackColor
.IsEmpty ||
System\Windows\Forms\Controls\DataGridView\DataGridViewColumn.cs (4)
213
return (!defaultCellStyle.
BackColor
.IsEmpty ||
445
if (columnStyle is not null && !columnStyle.
BackColor
.IsEmpty)
447
inheritedCellStyleTmp.BackColor = columnStyle.
BackColor
;
451
inheritedCellStyleTmp.BackColor = dataGridViewStyle.
BackColor
;
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnHeaderCell.cs (7)
301
if (cellStyle is not null && !cellStyle.
BackColor
.IsEmpty)
303
inheritedCellStyleTmp.BackColor = cellStyle.
BackColor
;
305
else if (!columnHeadersStyle.
BackColor
.IsEmpty)
307
inheritedCellStyleTmp.BackColor = columnHeadersStyle.
BackColor
;
311
inheritedCellStyleTmp.BackColor = dataGridViewStyle.
BackColor
;
868
? cellStyle.SelectionBackColor : cellStyle.
BackColor
;
1004
(Color darkColor, Color lightColor) = GetContrastedColors(cellStyle.
BackColor
);
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxCell.cs (2)
1926
: cellStyle.
BackColor
;
2071
brushColor = cellStyle.
BackColor
;
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxEditingControl.cs (3)
74
if (dataGridViewCellStyle.
BackColor
.A < 255)
77
Color opaqueBackColor = Color.FromArgb(255, dataGridViewCellStyle.
BackColor
);
83
BackColor = dataGridViewCellStyle.
BackColor
;
System\Windows\Forms\Controls\DataGridView\DataGridViewHeaderCell.cs (1)
545
? cellStyle.SelectionBackColor : cellStyle.
BackColor
;
System\Windows\Forms\Controls\DataGridView\DataGridViewImageCell.cs (1)
778
: cellStyle.
BackColor
;
System\Windows\Forms\Controls\DataGridView\DataGridViewImageColumn.cs (1)
276
return (!defaultCellStyle.
BackColor
.IsEmpty ||
System\Windows\Forms\Controls\DataGridView\DataGridViewLinkCell.cs (1)
912
: cellStyle.
BackColor
;
System\Windows\Forms\Controls\DataGridView\DataGridViewRow.cs (14)
615
if (cellStyle is not null && !cellStyle.
BackColor
.IsEmpty)
617
inheritedCellStyle.BackColor = cellStyle.
BackColor
;
619
else if (!rowHeadersStyle.
BackColor
.IsEmpty)
621
inheritedCellStyle.BackColor = rowHeadersStyle.
BackColor
;
625
inheritedCellStyle.BackColor = dataGridViewStyle.
BackColor
;
813
if (rowStyle is not null && !rowStyle.
BackColor
.IsEmpty)
815
inheritedRowStyle.BackColor = rowStyle.
BackColor
;
817
else if (!rowsDefaultCellStyle.
BackColor
.IsEmpty && (rowIndex % 2 == 0 || alternatingRowsDefaultCellStyle.
BackColor
.IsEmpty))
819
inheritedRowStyle.BackColor = rowsDefaultCellStyle.
BackColor
;
821
else if (rowIndex % 2 == 1 && !alternatingRowsDefaultCellStyle.
BackColor
.IsEmpty)
823
inheritedRowStyle.BackColor = alternatingRowsDefaultCellStyle.
BackColor
;
827
inheritedRowStyle.BackColor = dataGridViewStyle.
BackColor
;
1198
backColor = cellStyle.
BackColor
;
System\Windows\Forms\Controls\DataGridView\DataGridViewRowHeaderCell.cs (8)
326
if (cellStyle is not null && !cellStyle.
BackColor
.IsEmpty)
328
inheritedCellStyleTmp.BackColor = cellStyle.
BackColor
;
330
else if (!rowHeadersStyle.
BackColor
.IsEmpty)
332
inheritedCellStyleTmp.BackColor = rowHeadersStyle.
BackColor
;
336
inheritedCellStyleTmp.BackColor = dataGridViewStyle.
BackColor
;
737
: cellStyle.
BackColor
;
829
PaintIcon(graphics, bmp, valBounds, iconColor, cellStyle.
BackColor
);
985
PaintIcon(graphics, bmp, valBounds, iconColor, cellStyle.
BackColor
);
System\Windows\Forms\Controls\DataGridView\DataGridViewTextBoxCell.cs (1)
685
: cellStyle.
BackColor
;
System\Windows\Forms\Controls\DataGridView\DataGridViewTextBoxEditingControl.cs (3)
99
if (dataGridViewCellStyle.
BackColor
.A < 255)
102
Color opaqueBackColor = Color.FromArgb(255, dataGridViewCellStyle.
BackColor
);
109
BackColor = dataGridViewCellStyle.
BackColor
;
System\Windows\Forms\Controls\DataGridView\DataGridViewTopLeftHeaderCell.cs (2)
266
: cellStyle.
BackColor
;
373
(Color darkColor, Color lightColor) = GetContrastedColors(cellStyle.
BackColor
);
System.Windows.Forms.Design (3)
System\Windows\Forms\Design\DataGridViewColumnCollectionDialog.cs (3)
373
if (defaultSrcColumn is null || !defaultSrcColumn.DefaultCellStyle.
BackColor
.Equals(srcColumn.DefaultCellStyle.
BackColor
))
375
destColumn.DefaultCellStyle.BackColor = srcColumn.DefaultCellStyle.
BackColor
;
System.Windows.Forms.Design.Tests (1)
System\Windows\Forms\Design\DataGridViewCellStyleBuilderTests.cs (1)
23
result.
BackColor
.Should().Be(Color.Red);
System.Windows.Forms.Tests (12)
System\Windows\Forms\DataGridViewCellStyleTests.cs (12)
21
Assert.Equal(Color.Empty, style.
BackColor
);
62
Assert.Equal(Color.Red, style.
BackColor
);
87
Assert.Equal(Color.Empty, style.
BackColor
);
141
Assert.Equal(value, style.
BackColor
);
145
Assert.Equal(value, style.
BackColor
);
156
Assert.Equal(Color.Empty, style.
BackColor
);
640
Assert.Equal(Color.Red, style.
BackColor
);
682
Assert.Equal(Color.Red, style.
BackColor
);
730
Assert.Equal(Color.Red, style.
BackColor
);
755
Assert.Equal(Color.Empty, style.
BackColor
);
796
Assert.Equal(Color.Red, style.
BackColor
);
821
Assert.Equal(Color.Empty, style.
BackColor
);