132 references to Default
System.Windows.Forms (9)
System\Windows\Forms\Controls\Buttons\ButtonBase.cs (1)
1028
return TextFormatFlags.
Default
;
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxCell.cs (1)
831
return MeasureTextHeight(graphics, " ", cellStyle.Font!, int.MaxValue, TextFormatFlags.
Default
) + adjustment;
System\Windows\Forms\Controls\DataGridView\DataGridViewUtilities.cs (1)
448
TextFormatFlags.
Default
|
System\Windows\Forms\Controls\Labels\Label.cs (1)
1074
TextFormatFlags format = FlatStyle == FlatStyle.System ? TextFormatFlags.
Default
: CreateTextFormatFlags(proposedConstraints);
System\Windows\Forms\Controls\ListBoxes\CheckedListBox.cs (1)
686
TextFormatFlags flags = TextFormatFlags.
Default
;
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.ToolStripItemInternalLayout.cs (1)
84
TextFormatFlags textFormat = TextFormatFlags.
Default
;
System\Windows\Forms\Controls\TreeView\TreeView.cs (2)
2852
TextRenderer.DrawText(g, node.Text, font, bounds, color, TextFormatFlags.
Default
);
2859
TextRenderer.DrawText(g, node.Text, font, bounds, color, TextFormatFlags.
Default
);
System\Windows\Forms\Rendering\TextRenderer.cs (1)
286
TextFormatFlags flags = TextFormatFlags.
Default
)
System.Windows.Forms.Tests (123)
System\Windows\Forms\CheckBoxRendererTests.cs (3)
84
[InlineData(TextFormatFlags.
Default
, CheckBoxState.CheckedNormal)]
85
[InlineData(TextFormatFlags.
Default
, CheckBoxState.MixedNormal)]
139
CheckBoxRenderer.DrawCheckBox(graphics, point, bounds, control.Text, SystemFonts.DefaultFont, TextFormatFlags.
Default
, focus, cBState, HWND.Null);
System\Windows\Forms\ControlPaintTests.cs (2)
1948
yield return new object[] { s, SystemFonts.MenuFont, Color.Red, new Rectangle(1, 2, 3, 4), TextFormatFlags.
Default
};
1977
Assert.Throws<ArgumentNullException>("dc", () => ControlPaint.DrawStringDisabled(null, s, SystemFonts.MenuFont, Color.Red, new Rectangle(1, 2, 3, 4), TextFormatFlags.
Default
));
System\Windows\Forms\DataGridViewCellTests.cs (39)
5254
int height = DataGridViewCell.MeasureTextHeight(graphics, text, SystemFonts.DefaultFont, 10, TextFormatFlags.
Default
);
5257
height = DataGridViewCell.MeasureTextHeight(graphics, text, SystemFonts.DefaultFont, 10, TextFormatFlags.
Default
, out bool widthTruncated);
5269
int height = DataGridViewCell.MeasureTextHeight(graphics, text, SystemFonts.DefaultFont, 20, TextFormatFlags.
Default
);
5272
height = DataGridViewCell.MeasureTextHeight(graphics, text, SystemFonts.DefaultFont, 20, TextFormatFlags.
Default
, out bool widthTruncated);
5281
Assert.Throws<ArgumentNullException>("graphics", () => DataGridViewCell.MeasureTextHeight(null, "text", SystemFonts.DefaultFont, 10, TextFormatFlags.
Default
));
5282
Assert.Throws<ArgumentNullException>("graphics", () => DataGridViewCell.MeasureTextHeight(null, "text", SystemFonts.DefaultFont, 10, TextFormatFlags.
Default
, out widthTruncated));
5292
Assert.Throws<ArgumentNullException>("font", () => DataGridViewCell.MeasureTextHeight(graphics, "text", null, 10, TextFormatFlags.
Default
));
5293
Assert.Throws<ArgumentNullException>("font", () => DataGridViewCell.MeasureTextHeight(graphics, "text", null, 10, TextFormatFlags.
Default
, out widthTruncated));
5305
Assert.Throws<ArgumentOutOfRangeException>("maxWidth", () => DataGridViewCell.MeasureTextHeight(graphics, "text", SystemFonts.DefaultFont, maxWidth, TextFormatFlags.
Default
));
5306
Assert.Throws<ArgumentOutOfRangeException>("maxWidth", () => DataGridViewCell.MeasureTextHeight(graphics, "text", SystemFonts.DefaultFont, maxWidth, TextFormatFlags.
Default
, out widthTruncated));
5328
Assert.Equal(Size.Empty, DataGridViewCell.MeasureTextPreferredSize(graphics, text, SystemFonts.DefaultFont, 0.2f, TextFormatFlags.
Default
));
5332
[InlineData("a", TextFormatFlags.
Default
)]
5333
[InlineData("truncate_me", TextFormatFlags.
Default
)]
5334
[InlineData("truncate_me\r\nnew\rn\nnew", TextFormatFlags.
Default
)]
5335
[InlineData("truncate_me\r\nnew\rn\nnew", TextFormatFlags.
Default
| TextFormatFlags.SingleLine)]
5336
[InlineData("truncate_me\r\truncate_me_again", TextFormatFlags.
Default
)]
5337
[InlineData("truncate_me\r\truncate_me_again", TextFormatFlags.
Default
| TextFormatFlags.SingleLine)]
5348
Assert.Throws<ArgumentNullException>("graphics", () => DataGridViewCell.MeasureTextPreferredSize(null, "text", SystemFonts.DefaultFont, 0.2f, TextFormatFlags.
Default
));
5356
Assert.Throws<ArgumentNullException>("font", () => DataGridViewCell.MeasureTextPreferredSize(graphics, "text", null, 0.2f, TextFormatFlags.
Default
));
5366
Assert.Throws<ArgumentOutOfRangeException>("maxRatio", () => DataGridViewCell.MeasureTextPreferredSize(graphics, "text", SystemFonts.DefaultFont, maxRatio, TextFormatFlags.
Default
));
5384
Assert.Equal(Size.Empty, DataGridViewCell.MeasureTextSize(graphics, text, SystemFonts.DefaultFont, TextFormatFlags.
Default
));
5388
[InlineData("a", TextFormatFlags.
Default
)]
5389
[InlineData("truncate_me", TextFormatFlags.
Default
)]
5390
[InlineData("truncate_me\r\nnew\rn\nnew", TextFormatFlags.
Default
)]
5391
[InlineData("truncate_me\r\nnew\rn\nnew", TextFormatFlags.
Default
| TextFormatFlags.SingleLine)]
5392
[InlineData("truncate_me\r\truncate_me_again", TextFormatFlags.
Default
)]
5393
[InlineData("truncate_me\r\truncate_me_again", TextFormatFlags.
Default
| TextFormatFlags.SingleLine)]
5404
Assert.Throws<ArgumentNullException>("graphics", () => DataGridViewCell.MeasureTextSize(null, "text", SystemFonts.DefaultFont, TextFormatFlags.
Default
));
5412
Assert.Throws<ArgumentNullException>("font", () => DataGridViewCell.MeasureTextSize(graphics, "text", null, TextFormatFlags.
Default
));
5430
Assert.Equal(0, DataGridViewCell.MeasureTextWidth(graphics, text, SystemFonts.DefaultFont, 10, TextFormatFlags.
Default
));
5434
[InlineData("a", TextFormatFlags.
Default
)]
5435
[InlineData("truncate_me", TextFormatFlags.
Default
)]
5436
[InlineData("truncate_me\r\nnew\rn\nnew", TextFormatFlags.
Default
)]
5437
[InlineData("truncate_me\r\nnew\rn\nnew", TextFormatFlags.
Default
| TextFormatFlags.SingleLine)]
5438
[InlineData("truncate_me\r\truncate_me_again", TextFormatFlags.
Default
)]
5439
[InlineData("truncate_me\r\truncate_me_again", TextFormatFlags.
Default
| TextFormatFlags.SingleLine)]
5450
Assert.Throws<ArgumentNullException>("graphics", () => DataGridViewCell.MeasureTextWidth(null, "text", SystemFonts.DefaultFont, 10, TextFormatFlags.
Default
));
5458
Assert.Throws<ArgumentNullException>("font", () => DataGridViewCell.MeasureTextWidth(graphics, "text", null, 10, TextFormatFlags.
Default
));
5468
Assert.Throws<ArgumentOutOfRangeException>("maxHeight", () => DataGridViewCell.MeasureTextWidth(graphics, "text", SystemFonts.DefaultFont, maxHeight, TextFormatFlags.
Default
));
System\Windows\Forms\RadioButtonRendererTests.cs (3)
78
[InlineData(TextFormatFlags.
Default
, RadioButtonState.CheckedNormal)]
79
[InlineData(TextFormatFlags.
Default
, RadioButtonState.CheckedPressed)]
124
TextFormatFlags.
Default
,
System\Windows\Forms\TextRendererTests.cs (62)
84
yield return new object[] { hint, text, null, Point.Empty, Color.Red, TextFormatFlags.
Default
, };
85
yield return new object[] { hint, text, SystemFonts.MenuFont, new Point(1, 2), Color.Red, TextFormatFlags.
Default
, };
86
yield return new object[] { hint, text, SystemFonts.MenuFont, new Point(1, 2), Color.Black, TextFormatFlags.
Default
, };
87
yield return new object[] { hint, text, SystemFonts.MenuFont, new Point(1, 2), Color.White, TextFormatFlags.
Default
, };
88
yield return new object[] { hint, text, SystemFonts.MenuFont, new Point(1, 2), Color.Transparent, TextFormatFlags.
Default
, };
89
yield return new object[] { hint, text, SystemFonts.MenuFont, new Point(1, 2), Color.Empty, TextFormatFlags.
Default
, };
121
yield return new object[] { hint, text, null, Point.Empty, Color.Red, Color.Blue, TextFormatFlags.
Default
, };
122
yield return new object[] { hint, text, SystemFonts.MenuFont, new Point(1, 2), Color.Red, Color.Blue, TextFormatFlags.
Default
, };
123
yield return new object[] { hint, text, SystemFonts.MenuFont, new Point(1, 2), Color.Black, Color.Blue, TextFormatFlags.
Default
, };
124
yield return new object[] { hint, text, SystemFonts.MenuFont, new Point(1, 2), Color.White, Color.Blue, TextFormatFlags.
Default
, };
125
yield return new object[] { hint, text, SystemFonts.MenuFont, new Point(1, 2), Color.Transparent, Color.Blue, TextFormatFlags.
Default
, };
126
yield return new object[] { hint, text, SystemFonts.MenuFont, new Point(1, 2), Color.Empty, Color.Blue, TextFormatFlags.
Default
, };
127
yield return new object[] { hint, text, SystemFonts.MenuFont, Point.Empty, Color.Red, Color.Red, TextFormatFlags.
Default
, };
128
yield return new object[] { hint, text, SystemFonts.MenuFont, Point.Empty, Color.Red, Color.Black, TextFormatFlags.
Default
, };
129
yield return new object[] { hint, text, SystemFonts.MenuFont, Point.Empty, Color.Red, Color.White, TextFormatFlags.
Default
, };
130
yield return new object[] { hint, text, SystemFonts.MenuFont, Point.Empty, Color.Red, Color.Transparent, TextFormatFlags.
Default
, };
131
yield return new object[] { hint, text, SystemFonts.MenuFont, Point.Empty, Color.Red, Color.Empty, TextFormatFlags.
Default
, };
230
yield return new object[] { hint, text, null, Rectangle.Empty, Color.Red, TextFormatFlags.
Default
, };
231
yield return new object[] { hint, text, null, new Rectangle(1, 2, -3, -4), Color.Red, TextFormatFlags.
Default
, };
232
yield return new object[] { hint, text, null, new Rectangle(1, 2, int.MaxValue, int.MaxValue), Color.Red, TextFormatFlags.
Default
, };
233
yield return new object[] { hint, text, SystemFonts.MenuFont, new Rectangle(1, 2, 300, 400), Color.Red, TextFormatFlags.
Default
, };
234
yield return new object[] { hint, text, SystemFonts.MenuFont, new Rectangle(1, 2, 300, 400), Color.Black, TextFormatFlags.
Default
, };
235
yield return new object[] { hint, text, SystemFonts.MenuFont, new Rectangle(1, 2, 300, 400), Color.White, TextFormatFlags.
Default
, };
236
yield return new object[] { hint, text, SystemFonts.MenuFont, new Rectangle(1, 2, 300, 400), Color.Transparent, TextFormatFlags.
Default
, };
237
yield return new object[] { hint, text, SystemFonts.MenuFont, new Rectangle(1, 2, 300, 400), Color.Empty, TextFormatFlags.
Default
, };
270
yield return new object[] { hint, text, null, Rectangle.Empty, Color.Red, Color.Blue, TextFormatFlags.
Default
, };
271
yield return new object[] { hint, text, null, new Rectangle(1, 2, -3, -4), Color.Red, Color.Blue, TextFormatFlags.
Default
, };
272
yield return new object[] { hint, text, null, new Rectangle(1, 2, int.MaxValue, int.MaxValue), Color.Blue, Color.Blue, TextFormatFlags.
Default
, };
273
yield return new object[] { hint, text, SystemFonts.MenuFont, new Rectangle(1, 2, 300, 400), Color.Red, Color.Blue, TextFormatFlags.
Default
, };
274
yield return new object[] { hint, text, SystemFonts.MenuFont, new Rectangle(1, 2, 300, 400), Color.Black, Color.Blue, TextFormatFlags.
Default
, };
275
yield return new object[] { hint, text, SystemFonts.MenuFont, new Rectangle(1, 2, 300, 400), Color.White, Color.Blue, TextFormatFlags.
Default
, };
276
yield return new object[] { hint, text, SystemFonts.MenuFont, new Rectangle(1, 2, 300, 400), Color.Transparent, Color.Blue, TextFormatFlags.
Default
, };
277
yield return new object[] { hint, text, SystemFonts.MenuFont, new Rectangle(1, 2, 300, 400), Color.Empty, Color.Blue, TextFormatFlags.
Default
, };
278
yield return new object[] { hint, text, SystemFonts.MenuFont, new Rectangle(1, 2, 300, 400), Color.Red, Color.Red, TextFormatFlags.
Default
, };
279
yield return new object[] { hint, text, SystemFonts.MenuFont, new Rectangle(1, 2, 300, 400), Color.Red, Color.Black, TextFormatFlags.
Default
, };
280
yield return new object[] { hint, text, SystemFonts.MenuFont, new Rectangle(1, 2, 300, 400), Color.Red, Color.White, TextFormatFlags.
Default
, };
281
yield return new object[] { hint, text, SystemFonts.MenuFont, new Rectangle(1, 2, 300, 400), Color.Red, Color.Transparent, TextFormatFlags.
Default
, };
282
yield return new object[] { hint, text, SystemFonts.MenuFont, new Rectangle(1, 2, 300, 400), Color.Red, Color.Empty, TextFormatFlags.
Default
, };
331
TextRenderer.DrawText(mockDeviceContext.Object, "text", SystemFonts.MenuFont, Point.Empty, Color.Red, TextFormatFlags.
Default
);
335
TextRenderer.DrawText(mockDeviceContext.Object, "text", SystemFonts.MenuFont, Point.Empty, Color.Red, Color.Blue, TextFormatFlags.
Default
);
343
TextRenderer.DrawText(mockDeviceContext.Object, "text", SystemFonts.MenuFont, new Rectangle(1, 2, 300, 400), Color.Red, TextFormatFlags.
Default
);
351
TextRenderer.DrawText(mockDeviceContext.Object, "text", SystemFonts.MenuFont, new Rectangle(1, 2, 300, 400), Color.Red, Color.Blue, TextFormatFlags.
Default
);
363
TextRenderer.DrawText(mockDeviceContext.Object, "text".AsSpan(), SystemFonts.MenuFont, Point.Empty, Color.Red, TextFormatFlags.
Default
);
367
TextRenderer.DrawText(mockDeviceContext.Object, "text".AsSpan(), SystemFonts.MenuFont, Point.Empty, Color.Red, Color.Blue, TextFormatFlags.
Default
);
375
TextRenderer.DrawText(mockDeviceContext.Object, "text".AsSpan(), SystemFonts.MenuFont, new Rectangle(1, 2, 300, 400), Color.Red, TextFormatFlags.
Default
);
383
TextRenderer.DrawText(mockDeviceContext.Object, "text".AsSpan(), SystemFonts.MenuFont, new Rectangle(1, 2, 300, 400), Color.Red, Color.Blue, TextFormatFlags.
Default
);
438
yield return new object[] { "string", null, Size.Empty, TextFormatFlags.
Default
};
439
yield return new object[] { "string", null, new Size(1, 2), TextFormatFlags.
Default
};
440
yield return new object[] { "string", null, new Size(100, 200), TextFormatFlags.
Default
};
441
yield return new object[] { "string", null, new Size(int.MaxValue, int.MaxValue), TextFormatFlags.
Default
};
442
yield return new object[] { "string", SystemFonts.MenuFont, Size.Empty, TextFormatFlags.
Default
};
443
yield return new object[] { "string", SystemFonts.MenuFont, new Size(1, 2), TextFormatFlags.
Default
};
444
yield return new object[] { "string", SystemFonts.MenuFont, new Size(100, 200), TextFormatFlags.
Default
};
445
yield return new object[] { "string", SystemFonts.MenuFont, new Size(int.MaxValue, int.MaxValue), TextFormatFlags.
Default
};
521
Assert.Equal(Size.Empty, TextRenderer.MeasureText(text, SystemFonts.MenuFont, new Size(300, 400), TextFormatFlags.
Default
));
524
Assert.Equal(Size.Empty, TextRenderer.MeasureText(graphics, text, SystemFonts.MenuFont, new Size(300, 400), TextFormatFlags.
Default
));
527
Assert.Equal(Size.Empty, TextRenderer.MeasureText(text.AsSpan(), SystemFonts.MenuFont, new Size(300, 400), TextFormatFlags.
Default
));
530
Assert.Equal(Size.Empty, TextRenderer.MeasureText(graphics, text.AsSpan(), SystemFonts.MenuFont, new Size(300, 400), TextFormatFlags.
Default
));
556
TextRenderer.MeasureText(mockDeviceContext.Object, "text", SystemFonts.MenuFont, new Size(300, 400), TextFormatFlags.
Default
);
566
Assert.Throws<ArgumentNullException>("dc", () => TextRenderer.MeasureText(null, string.Empty, SystemFonts.MenuFont, new Size(300, 400), TextFormatFlags.
Default
));
792
{ TextFormatFlags.
Default
, new Rectangle(3, 0, 49, 12) },
829
{ TextFormatFlags.
Default
, new Size(57, 13) },
System\Windows\Forms\ToolStripItemTextRenderEventArgsTests.cs (4)
37
yield return new object[] { new ToolStripButton(), null, Rectangle.Empty, Color.Empty, null, ContentAlignment.TopLeft - 1, TextFormatFlags.
Default
| TextFormatFlags.Top | TextFormatFlags.HidePrefix };
38
yield return new object[] { new ToolStripButton(), "", new Rectangle(1, 2, 3, 4), Color.Red, SystemFonts.DefaultFont, ContentAlignment.MiddleCenter, TextFormatFlags.
Default
| TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter | TextFormatFlags.HidePrefix };
39
yield return new object[] { new ToolStripButton(), "", new Rectangle(1, 2, 3, 4), Color.Red, SystemFonts.DefaultFont, ContentAlignment.BottomRight, TextFormatFlags.
Default
| TextFormatFlags.Bottom | TextFormatFlags.Right | TextFormatFlags.HidePrefix };
40
yield return new object[] { new ToolStripButton() { RightToLeft = RightToLeft.Yes }, "text", new Rectangle(1, 2, 3, 4), Color.Red, SystemFonts.DefaultFont, (ContentAlignment)(-1), TextFormatFlags.
Default
| TextFormatFlags.Bottom | TextFormatFlags.Right | TextFormatFlags.RightToLeft | TextFormatFlags.HidePrefix };
System\Windows\Forms\VisualStyles\VisualStyleRendererTests.cs (10)
461
yield return new object[] { new Rectangle(1, 2, 3, 4), textToDraw, drawDisabled, TextFormatFlags.
Default
};
463
yield return new object[] { new Rectangle(0, 0, 0, 4), textToDraw, drawDisabled, TextFormatFlags.
Default
};
464
yield return new object[] { new Rectangle(0, 0, -1, 4), textToDraw, drawDisabled, TextFormatFlags.
Default
};
465
yield return new object[] { new Rectangle(0, 0, 3, 0), textToDraw, drawDisabled, TextFormatFlags.
Default
};
466
yield return new object[] { new Rectangle(0, 0, 3, -1), textToDraw, drawDisabled, TextFormatFlags.
Default
};
467
yield return new object[] { new Rectangle(0, 0, 0, 0), textToDraw, drawDisabled, TextFormatFlags.
Default
};
468
yield return new object[] { new Rectangle(0, 0, -1, -1), textToDraw, drawDisabled, TextFormatFlags.
Default
};
469
yield return new object[] { new Rectangle(-1, -2, 3, 4), textToDraw, drawDisabled, TextFormatFlags.
Default
};
494
Assert.Throws<ArgumentNullException>("dc", () => renderer.DrawText(null, new Rectangle(1, 2, 3, 4), "text", true, TextFormatFlags.
Default
));
495
Assert.Throws<ArgumentNullException>("dc", () => renderer.DrawText(null, new Rectangle(1, 2, 3, 4), "text", false, TextFormatFlags.
Default
));