71 writes to Font
System.Windows.Forms (31)
System\Windows\Forms\Controls\DataGridView\DataGridView.cs (4)
1545
Font
= base.Font,
2007
defaultCellStyleTmp.
Font
= base.Font;
2058
Font
= base.Font,
2095
Font
= base.Font,
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (4)
2859
inheritedCellStyle.
Font
= cellStyle?.Font ?? columnHeadersStyle.Font ?? dataGridViewStyle.Font;
15090
ColumnHeadersDefaultCellStyle.
Font
= base.Font;
15098
RowHeadersDefaultCellStyle.
Font
= base.Font;
15106
DefaultCellStyle.
Font
= base.Font;
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (6)
2037
inheritedCellStyleTmp.
Font
= cellStyle.Font;
2041
inheritedCellStyleTmp.
Font
= rowStyle.Font;
2046
inheritedCellStyleTmp.
Font
= DataGridView.RowsDefaultCellStyle.Font;
2050
inheritedCellStyleTmp.
Font
= DataGridView.AlternatingRowsDefaultCellStyle.Font;
2054
inheritedCellStyleTmp.
Font
= columnStyle.Font;
2058
inheritedCellStyleTmp.
Font
= dataGridViewStyle.Font;
System\Windows\Forms\Controls\DataGridView\DataGridViewCellStyle.cs (2)
49
Font
= dataGridViewCellStyle.Font;
400
Font
= dataGridViewCellStyle.Font;
System\Windows\Forms\Controls\DataGridView\DataGridViewColumn.cs (2)
483
inheritedCellStyleTmp.
Font
= columnStyle.Font;
487
inheritedCellStyleTmp.
Font
= dataGridViewStyle.Font;
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnHeaderCell.cs (3)
356
inheritedCellStyleTmp.
Font
= cellStyle.Font;
360
inheritedCellStyleTmp.
Font
= columnHeadersStyle.Font;
364
inheritedCellStyleTmp.
Font
= dataGridViewStyle.Font;
System\Windows\Forms\Controls\DataGridView\DataGridViewRow.cs (7)
669
inheritedCellStyle.
Font
= cellStyle.Font;
673
inheritedCellStyle.
Font
= rowHeadersStyle.Font;
677
inheritedCellStyle.
Font
= dataGridViewStyle.Font;
883
inheritedRowStyle.
Font
= rowStyle.Font;
888
inheritedRowStyle.
Font
= rowsDefaultCellStyle.Font;
892
inheritedRowStyle.
Font
= alternatingRowsDefaultCellStyle.Font;
896
inheritedRowStyle.
Font
= dataGridViewStyle.Font;
System\Windows\Forms\Controls\DataGridView\DataGridViewRowHeaderCell.cs (3)
381
inheritedCellStyleTmp.
Font
= cellStyle.Font;
385
inheritedCellStyleTmp.
Font
= rowHeadersStyle.Font;
389
inheritedCellStyleTmp.
Font
= dataGridViewStyle.Font;
System.Windows.Forms.Design (1)
System\Windows\Forms\Design\DataGridViewColumnCollectionDialog.cs (1)
380
destColumn.DefaultCellStyle.
Font
= srcColumn.DefaultCellStyle.Font;
System.Windows.Forms.Tests (31)
System\Windows\Forms\DataGridViewCellStyleTests.cs (15)
47
Font
= SystemFonts.DefaultFont,
271
Font
= value
276
style.
Font
= value;
285
Font
= SystemFonts.DefaultFont
287
style.
Font
= null;
624
Font
= SystemFonts.DefaultFont,
667
Font
= SystemFonts.DefaultFont,
715
Font
= SystemFonts.DefaultFont,
781
Font
= SystemFonts.DefaultFont,
907
new DataGridViewCellStyle {
Font
= font },
908
new DataGridViewCellStyle {
Font
= font },
913
new DataGridViewCellStyle {
Font
= font },
914
new DataGridViewCellStyle {
Font
= SystemFonts.MenuFont },
1072
new DataGridViewCellStyle {
Font
= SystemFonts.DefaultFont },
1129
Font
= font,
System\Windows\Forms\DataGridViewRowTests.cs (2)
2068
Font
= font1,
2084
Font
= font2,
System\Windows\Forms\DataGridViewTests.cs (7)
799
yield return new object[] { new DataGridViewCellStyle {
Font
= null } };
2334
Font
= customFont1,
2350
ColumnHeadersDefaultCellStyle = new DataGridViewCellStyle {
Font
= customFont2 },
2351
RowHeadersDefaultCellStyle = new DataGridViewCellStyle {
Font
= customFont3 }
2380
dataGridView.DefaultCellStyle.
Font
= customFont2;
2381
dataGridView.ColumnHeadersDefaultCellStyle.
Font
= customFont3;
2382
dataGridView.RowHeadersDefaultCellStyle.
Font
= customFont1;
System\Windows\Forms\DataGridViewTests.Rendering.cs (3)
119
Font
= customCellStyleFont,
135
ColumnHeadersDefaultCellStyle = new DataGridViewCellStyle {
Font
= customColumnHeaderFont },
136
RowHeadersDefaultCellStyle = new DataGridViewCellStyle {
Font
= customRowHeaderFont },
System\Windows\Forms\DataGridViewTextBoxEditingControlTests.cs (4)
553
Font
= font,
561
Font
= font,
762
Font
= font,
770
Font
= font,
WinFormsControlsTest (8)
DataGridViewTest.cs (6)
74
dataGridView1.DefaultCellStyle.
Font
= s_fonts[_cellFontIndex];
77
dataGridView1.ColumnHeadersDefaultCellStyle.
Font
= s_fonts[_columnHeaderFontIndex];
80
dataGridView1.RowHeadersDefaultCellStyle.
Font
= s_fonts[_rowHeaderFontIndex];
86
dataGridView1.DefaultCellStyle.
Font
= null;
87
dataGridView1.ColumnHeadersDefaultCellStyle.
Font
= null;
88
dataGridView1.RowHeadersDefaultCellStyle.
Font
= null;
DataGridViewTest.Designer.cs (2)
58
dataGridViewCellStyle1.
Font
= new System.Drawing.Font("Cascadia Code", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
76
dataGridViewCellStyle3.
Font
= new System.Drawing.Font("Consolas", 8.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
147 references to Font
System.Windows.Forms (113)
System\Windows\Forms\Controls\DataGridView\DataGridView.cs (5)
1524
_dataGridViewState1[State1_AmbientColumnHeadersFont] = value?.
Font
== base.Font;
1976
|| _defaultCellStyle.
Font
is null
2005
if (_defaultCellStyle.
Font
is null)
2037
_dataGridViewState1[State1_AmbientFont] = value?.
Font
== base.Font;
3311
_dataGridViewState1[State1_AmbientRowHeadersFont] = value?.
Font
== base.Font;
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (6)
2859
inheritedCellStyle.Font = cellStyle?.
Font
?? columnHeadersStyle.
Font
?? dataGridViewStyle.
Font
;
15088
if (_dataGridViewState1[State1_AmbientColumnHeadersFont] && ColumnHeadersDefaultCellStyle.
Font
!= base.Font)
15096
if (_dataGridViewState1[State1_AmbientRowHeadersFont] && RowHeadersDefaultCellStyle.
Font
!= base.Font)
15104
if (_dataGridViewState1[State1_AmbientFont] && DefaultCellStyle.
Font
!= base.Font)
System\Windows\Forms\Controls\DataGridView\DataGridViewButtonCell.cs (9)
327
cellStyle.
Font
!,
335
MeasureTextSize(graphics, formattedString, cellStyle.
Font
!, flags).Width,
352
cellStyle.
Font
!,
363
cellStyle.
Font
!,
374
preferredSize = MeasureTextPreferredSize(graphics, formattedString, cellStyle.
Font
!, 5.0F, flags);
378
preferredSize = MeasureTextSize(graphics, formattedString, cellStyle.
Font
!, flags);
909
cellStyle.
Font
!,
939
cellStyle.
Font
!,
992
cellStyle.
Font
,
System\Windows\Forms\Controls\DataGridView\DataGridViewButtonColumn.cs (1)
218
defaultCellStyle.
Font
is not null ||
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (14)
2035
if (cellStyle is not null && cellStyle.
Font
is not null)
2037
inheritedCellStyleTmp.Font = cellStyle.
Font
;
2039
else if (rowStyle is not null && rowStyle.
Font
is not null)
2041
inheritedCellStyleTmp.Font = rowStyle.
Font
;
2043
else if (DataGridView.RowsDefaultCellStyle.
Font
is not null &&
2044
(rowIndex % 2 == 0 || DataGridView.AlternatingRowsDefaultCellStyle.
Font
is null))
2046
inheritedCellStyleTmp.Font = DataGridView.RowsDefaultCellStyle.
Font
;
2048
else if (rowIndex % 2 == 1 && DataGridView.AlternatingRowsDefaultCellStyle.
Font
is not null)
2050
inheritedCellStyleTmp.Font = DataGridView.AlternatingRowsDefaultCellStyle.
Font
;
2052
else if (columnStyle is not null && columnStyle.
Font
is not null)
2054
inheritedCellStyleTmp.Font = columnStyle.
Font
;
2058
inheritedCellStyleTmp.Font = dataGridViewStyle.
Font
;
2324
return MeasureTextHeight(g, text, cellStyle.
Font
!, maxWidth, flags, out widthTruncated);
2328
Size size = MeasureTextSize(g, text, cellStyle.
Font
!, flags);
System\Windows\Forms\Controls\DataGridView\DataGridViewCellStyle.cs (8)
49
Font = dataGridViewCellStyle.
Font
;
398
if (dataGridViewCellStyle.
Font
is not null)
400
Font = dataGridViewCellStyle.
Font
;
456
dgvcs.
Font
!=
Font
||
495
hash.Add(
Font
);
577
if (
Font
is not null)
584
sb.Append($" Font={
Font
}");
System\Windows\Forms\Controls\DataGridView\DataGridViewCheckBoxCell.cs (3)
1406
cellStyle.
Font
!,
1455
cellStyle.
Font
!,
1502
cellStyle.
Font
!,
System\Windows\Forms\Controls\DataGridView\DataGridViewCheckBoxColumn.cs (1)
304
defaultCellStyle.
Font
is not null ||
System\Windows\Forms\Controls\DataGridView\DataGridViewColumn.cs (4)
217
defaultCellStyle.
Font
is not null ||
481
if (columnStyle is not null && columnStyle.
Font
is not null)
483
inheritedCellStyleTmp.Font = columnStyle.
Font
;
487
inheritedCellStyleTmp.Font = dataGridViewStyle.
Font
;
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnHeaderCell.cs (13)
354
if (cellStyle is not null && cellStyle.
Font
is not null)
356
inheritedCellStyleTmp.Font = cellStyle.
Font
;
358
else if (columnHeadersStyle.
Font
is not null)
360
inheritedCellStyleTmp.Font = columnHeadersStyle.
Font
;
364
inheritedCellStyleTmp.Font = dataGridViewStyle.
Font
;
520
cellStyle.
Font
!,
531
cellStyle.
Font
!,
588
cellStyle.
Font
!,
603
cellStyle.
Font
!,
617
cellStyle.
Font
!,
636
cellStyle.
Font
!,
645
cellStyle.
Font
!,
979
cellStyle.
Font
,
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxCell.cs (3)
828
return MeasureTextHeight(graphics, " ", cellStyle.
Font
!, int.MaxValue, TextFormatFlags.Default) + adjustment;
1181
MeasureTextSize(graphics, string.IsNullOrEmpty(formattedValue) ? " " : formattedValue, cellStyle.
Font
!, flags);
2335
cellStyle.
Font
,
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxEditingControl.cs (1)
73
Font = dataGridViewCellStyle.
Font
;
System\Windows\Forms\Controls\DataGridView\DataGridViewImageColumn.cs (1)
280
defaultCellStyle.
Font
is not null ||
System\Windows\Forms\Controls\DataGridView\DataGridViewLinkCell.cs (7)
575
cellStyle.
Font
!,
589
cellStyle.
Font
!,
600
cellStyle.
Font
!,
614
MeasureTextSize(graphics, formattedString, cellStyle.
Font
!, flags).Width,
623
MeasureTextSize(graphics, formattedString, cellStyle.
Font
!, flags).Height);
632
cellStyle.
Font
!,
952
LinkUtilities.EnsureLinkFonts(cellStyle.
Font
!, LinkBehavior, ref getLinkFont, ref getHoverFont, isActive);
System\Windows\Forms\Controls\DataGridView\DataGridViewRow.cs (13)
667
if (cellStyle is not null && cellStyle.
Font
is not null)
669
inheritedCellStyle.Font = cellStyle.
Font
;
671
else if (rowHeadersStyle.
Font
is not null)
673
inheritedCellStyle.Font = rowHeadersStyle.
Font
;
677
inheritedCellStyle.Font = dataGridViewStyle.
Font
;
881
if (rowStyle is not null && rowStyle.
Font
is not null)
883
inheritedRowStyle.Font = rowStyle.
Font
;
885
else if (rowsDefaultCellStyle.
Font
is not null &&
886
(rowIndex % 2 == 0 || alternatingRowsDefaultCellStyle.
Font
is null))
888
inheritedRowStyle.Font = rowsDefaultCellStyle.
Font
;
890
else if (rowIndex % 2 == 1 && alternatingRowsDefaultCellStyle.
Font
is not null)
892
inheritedRowStyle.Font = alternatingRowsDefaultCellStyle.
Font
;
896
inheritedRowStyle.Font = dataGridViewStyle.
Font
;
System\Windows\Forms\Controls\DataGridView\DataGridViewRowHeaderCell.cs (7)
379
if (cellStyle is not null && cellStyle.
Font
is not null)
381
inheritedCellStyleTmp.Font = cellStyle.
Font
;
383
else if (rowHeadersStyle.
Font
is not null)
385
inheritedCellStyleTmp.Font = rowHeadersStyle.
Font
;
389
inheritedCellStyleTmp.Font = dataGridViewStyle.
Font
;
859
cellStyle.
Font
!,
895
cellStyle.
Font
,
System\Windows\Forms\Controls\DataGridView\DataGridViewTextBoxCell.cs (8)
227
preferredHeight = MeasureTextHeight(screen, editedFormattedValue, cellStyle.
Font
!, originalWidth, flags);
421
cellStyle.
Font
!,
435
cellStyle.
Font
!,
446
cellStyle.
Font
!,
460
MeasureTextSize(graphics, formattedString, cellStyle.
Font
!, flags).Width,
469
MeasureTextSize(graphics, formattedString, cellStyle.
Font
!, flags).Height);
475
preferredSize = MeasureTextSize(graphics, formattedString, cellStyle.
Font
!, flags);
747
cellStyle.
Font
,
System\Windows\Forms\Controls\DataGridView\DataGridViewTextBoxEditingControl.cs (1)
98
Font = dataGridViewCellStyle.
Font
;
System\Windows\Forms\Controls\DataGridView\DataGridViewTopLeftHeaderCell.cs (1)
331
cellStyle.
Font
,
System\Windows\Forms\Controls\DataGridView\DataGridViewUtilities.cs (7)
176
preferredWidth = DataGridViewCell.MeasureTextWidth(graphics, val, cellStyle.
Font
!, maxHeight, flags);
180
preferredWidth = DataGridViewCell.MeasureTextSize(graphics, val, cellStyle.
Font
!, flags).Width;
237
minHeightContent = DataGridViewCell.MeasureTextHeight(graphics, val, cellStyle.
Font
!, allowedWidth, flags);
241
minHeightContent = DataGridViewCell.MeasureTextSize(graphics, val, cellStyle.
Font
!, flags).Height;
264
preferredSize = DataGridViewCell.MeasureTextPreferredSize(graphics, val, cellStyle.
Font
!, 5.0F, flags);
268
preferredSize = DataGridViewCell.MeasureTextSize(graphics, val, cellStyle.
Font
!, flags);
310
return GetTextBounds(cellBounds, text, flags, cellStyle, cellStyle.
Font
!);
System.Windows.Forms.Design (4)
System\Windows\Forms\Design\DataGridViewColumnCollectionDialog.cs (4)
378
if (defaultSrcColumn is not null && srcColumn.DefaultCellStyle.
Font
is not null && !srcColumn.DefaultCellStyle.
Font
.Equals(defaultSrcColumn.DefaultCellStyle.
Font
))
380
destColumn.DefaultCellStyle.Font = srcColumn.DefaultCellStyle.
Font
;
System.Windows.Forms.Tests (27)
System\Windows\Forms\DataGridViewCellStyleTests.cs (12)
23
Assert.Null(style.
Font
);
64
Assert.Equal(SystemFonts.DefaultFont, style.
Font
);
89
Assert.Null(style.
Font
);
273
Assert.Equal(value, style.
Font
);
277
Assert.Equal(value, style.
Font
);
288
Assert.Null(style.
Font
);
642
Assert.Equal(SystemFonts.DefaultFont, style.
Font
);
684
Assert.Equal(SystemFonts.DefaultFont, style.
Font
);
732
Assert.Equal(SystemFonts.DefaultFont, style.
Font
);
757
Assert.Null(style.
Font
);
798
Assert.Equal(SystemFonts.DefaultFont, style.
Font
);
823
Assert.Null(style.
Font
);
System\Windows\Forms\DataGridViewTests.cs (12)
2358
Assert.Same(customFont1, dataGridView.DefaultCellStyle.
Font
);
2359
Assert.Same(customFont2, dataGridView.ColumnHeadersDefaultCellStyle.
Font
);
2360
Assert.Same(customFont3, dataGridView.RowHeadersDefaultCellStyle.
Font
);
2366
Assert.Same(customFont1, dataGridView.DefaultCellStyle.
Font
);
2367
Assert.Same(customFont2, dataGridView.ColumnHeadersDefaultCellStyle.
Font
);
2368
Assert.Same(customFont3, dataGridView.RowHeadersDefaultCellStyle.
Font
);
2375
Assert.Same(customFont1, dataGridView.DefaultCellStyle.
Font
);
2376
Assert.Same(customFont2, dataGridView.ColumnHeadersDefaultCellStyle.
Font
);
2377
Assert.Same(customFont3, dataGridView.RowHeadersDefaultCellStyle.
Font
);
2384
Assert.Same(customFont2, dataGridView.DefaultCellStyle.
Font
);
2385
Assert.Same(customFont3, dataGridView.ColumnHeadersDefaultCellStyle.
Font
);
2386
Assert.Same(customFont1, dataGridView.RowHeadersDefaultCellStyle.
Font
);
System\Windows\Forms\DataGridViewTests.Rendering.cs (3)
155
Assert.Same(customCellStyleFont, dataGridView.DefaultCellStyle.
Font
);
156
Assert.Same(customColumnHeaderFont, dataGridView.ColumnHeadersDefaultCellStyle.
Font
);
157
Assert.Same(customRowHeaderFont, dataGridView.RowHeadersDefaultCellStyle.
Font
);
WinFormsControlsTest (3)
DataGridViewTest.cs (3)
27
dataGridView1.Rows.Add("DefaultCellStyle", dataGridView1.DefaultCellStyle.
Font
.ToString());
28
dataGridView1.Rows.Add("ColumnHeadersDefaultCellStyle", dataGridView1.ColumnHeadersDefaultCellStyle.
Font
.ToString());
29
dataGridView1.Rows.Add("RowHeadersDefaultCellStyle", dataGridView1.RowHeadersDefaultCellStyle.
Font
.ToString());