80 instantiations of StringFormat
PresentationUI (1)
MS\Internal\Documents\SignatureSummaryDialog.cs (1)
626StringFormat stringFormat = new StringFormat();
System.Drawing.Common (3)
System\Drawing\StringFormat.cs (3)
99public object Clone() => new StringFormat(this); 312return new StringFormat(format); 338return new StringFormat(format);
System.Drawing.Common.Tests (54)
mono\System.Drawing\GraphicsTests.cs (12)
1652using StringFormat string_format = new(); 1683using StringFormat string_format = new(); 1716using StringFormat string_format = new(); 1747using StringFormat string_format = new(); 1872Region[] regions = g.MeasureCharacterRanges("Mono", _font, default, new StringFormat()); 1875g.MeasureCharacterRanges("Mono".AsSpan(), _font, default, new StringFormat()); 1894using StringFormat string_format = new(); 1917using StringFormat string_format = new(); 1961using StringFormat string_format = new(); 2085using StringFormat fmt = new(); 2102using StringFormat fmt = new(); 2119using StringFormat format = new();
mono\System.Imaging\MetafileTest.cs (1)
311StringFormat sf = new()
System\Drawing\StringFormatTests.cs (41)
16using StringFormat format = new(); 31using StringFormat format = new(options); 47using StringFormat format = new(options, language); 60using StringFormat original = new(StringFormatFlags.NoClip, EnglishLanguageCode); 61using StringFormat format = new(original); 78AssertExtensions.Throws<ArgumentNullException>("format", () => new StringFormat(null)); 84StringFormat format = new(); 87AssertExtensions.Throws<ArgumentException>(null, () => new StringFormat(format)); 93StringFormat format = new(); 101using StringFormat original = new(StringFormatFlags.NoClip, EnglishLanguageCode); 119StringFormat format = new(); 132using StringFormat format = new(); 141StringFormat format = new(); 152using StringFormat format = new(); 162using StringFormat format = new(); 169using StringFormat format = new(); 176using StringFormat format = new(); 183StringFormat format = new(); 192StringFormat format = new(); 210using StringFormat format = new(); 217using StringFormat format = new(); 224using StringFormat format = new(); 231StringFormat format = new(); 243using StringFormat format = new() { Alignment = alignment }; 252using StringFormat format = new(); 259StringFormat format = new(); 269StringFormat format = new(); 278StringFormat format = new(); 290using StringFormat format = new() { FormatFlags = formatFlags }; 297StringFormat format = new(); 310using StringFormat format = new() { LineAlignment = alignment }; 319using StringFormat format = new(); 326StringFormat format = new(); 339using StringFormat format = new() { HotkeyPrefix = prefix }; 348using StringFormat format = new(); 355StringFormat format = new(); 366using StringFormat format = new() { Trimming = trimming }; 375using StringFormat format = new(); 382StringFormat format = new(); 422using StringFormat format = new(StringFormatFlags.DirectionVertical); 429StringFormat format = new(StringFormatFlags.DirectionVertical);
System.Windows.Forms (7)
System\Windows\Forms\Controls\Buttons\ButtonBase.cs (1)
1017return new StringFormat();
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.LayoutOptions.cs (1)
74StringFormat format = new()
System\Windows\Forms\Controls\GroupBox\GroupBox.cs (1)
474using StringFormat format = new StringFormat
System\Windows\Forms\Controls\ListBoxes\CheckedListBox.cs (1)
634using StringFormat format = new();
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridEntry.cs (1)
1594StringFormat stringFormat = new(StringFormatFlags.NoWrap)
System\Windows\Forms\Printing\PrintPreviewControl.cs (1)
603using StringFormat format = new()
System\Windows\Forms\Rendering\ControlPaint.cs (1)
2534StringFormat stringFormat = new()
System.Windows.Forms.Design (7)
System\ComponentModel\Design\CollectionEditor.CollectionEditorCollectionForm.cs (1)
605using (StringFormat format = new())
System\ComponentModel\Design\MultilineStringEditor.MultilineStringEditorUI.cs (1)
33_watermarkFormat = new StringFormat
System\Drawing\Design\FontNameEditor.cs (1)
74StringFormat format = new(StringFormatFlags.NoWrap | StringFormatFlags.NoFontFallback)
System\Windows\Forms\Design\ComponentTray.cs (1)
2279StringFormat format = new();
System\Windows\Forms\Design\ControlDesigner.cs (1)
2244StringFormat stringFormat = new StringFormat
System\Windows\Forms\Design\ToolStripCollectionEditor.ToolStripItemEditorForm.cs (2)
875stringFormat = rightToLeft ? new(StringFormatFlags.DirectionRightToLeft) : new();
System.Windows.Forms.Tests (8)
System\Windows\Forms\ControlPaintTests.cs (8)
1903yield return new object[] { s, SystemFonts.MenuFont, Color.Red, RectangleF.Empty, new StringFormat() }; 1904yield return new object[] { s, SystemFonts.MenuFont, Color.Red, new RectangleF(1, 2, -3, -4), new StringFormat() }; 1905yield return new object[] { s, SystemFonts.MenuFont, Color.Red, new RectangleF(1, 2, 3, 4), new StringFormat() }; 1906yield return new object[] { s, SystemFonts.MenuFont, Color.Black, new RectangleF(1, 2, 3, 4), new StringFormat() }; 1907yield return new object[] { s, SystemFonts.MenuFont, Color.White, new RectangleF(1, 2, 3, 4), new StringFormat() }; 1908yield return new object[] { s, SystemFonts.MenuFont, Color.Transparent, new RectangleF(1, 2, 3, 4), new StringFormat() }; 1909yield return new object[] { s, SystemFonts.MenuFont, Color.Empty, new RectangleF(1, 2, 3, 4), new StringFormat() }; 1943Assert.Throws<ArgumentNullException>("graphics", () => ControlPaint.DrawStringDisabled(null, s, SystemFonts.MenuFont, Color.Red, new RectangleF(1, 2, 3, 4), new StringFormat()));
186 references to StringFormat
PresentationUI (1)
MS\Internal\Documents\SignatureSummaryDialog.cs (1)
626StringFormat stringFormat = new StringFormat();
System.Drawing (1)
System.Drawing.cs (1)
150[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Drawing.StringFormat))]
System.Drawing.Common (72)
System\Drawing\Drawing2D\GraphicsPath.cs (4)
777public void AddString(string s, FontFamily family, int style, float emSize, PointF origin, StringFormat? format) => 780public void AddString(string s, FontFamily family, int style, float emSize, Point origin, StringFormat? format) => 783public void AddString(string s, FontFamily family, int style, float emSize, RectangleF layoutRect, StringFormat? format) 805public void AddString(string s, FontFamily family, int style, float emSize, Rectangle layoutRect, StringFormat? format)
System\Drawing\Graphics.cs (47)
1618/// <see cref="Font"/> objects using the formatting attributes of the specified <see cref="StringFormat"/>. 1626/// <see cref="StringFormat"/> that specifies formatting attributes, such as line spacing and alignment, 1632public void DrawString(string? s, Font font, Brush brush, float x, float y, StringFormat? format) => 1636/// <inheritdoc cref="DrawString(string?, Font, Brush, float, float, StringFormat?)"/> 1637public void DrawString(ReadOnlySpan<char> s, Font font, Brush brush, float x, float y, StringFormat? format) => 1643/// <see cref="Font"/> objects using the formatting attributes of the specified <see cref="StringFormat"/>. 1650/// <see cref="StringFormat"/> that specifies formatting attributes, such as line spacing and alignment, 1656public void DrawString(string? s, Font font, Brush brush, PointF point, StringFormat? format) => 1660/// <inheritdoc cref="DrawString(string?, Font, Brush, PointF, StringFormat?)"/> 1661public void DrawString(ReadOnlySpan<char> s, Font font, Brush brush, PointF point, StringFormat? format) => 1681/// <see cref="DrawString(string?, Font, Brush, RectangleF, StringFormat?)"/> overload that takes 1682/// a <see cref="StringFormat"/>. 1694/// <see cref="DrawString(ReadOnlySpan{char}, Font, Brush, RectangleF, StringFormat?)"/> overload that takes 1695/// a <see cref="StringFormat"/>. 1705/// <see cref="Font"/> objects using the formatting attributes of the specified <see cref="StringFormat"/>. 1712/// <see cref="StringFormat"/> that specifies formatting attributes, such as line spacing and alignment, 1725public void DrawString(string? s, Font font, Brush brush, RectangleF layoutRectangle, StringFormat? format) => 1729/// <inheritdoc cref="DrawString(string?, Font, Brush, RectangleF, StringFormat?)"/> 1730public void DrawString(ReadOnlySpan<char> s, Font font, Brush brush, RectangleF layoutRectangle, StringFormat? format) => 1734private void DrawStringInternal(ReadOnlySpan<char> s, Font font, Brush brush, RectangleF layoutRectangle, StringFormat? format) 1763/// <inheritdoc cref="MeasureString(string?, Font, SizeF, StringFormat?)"/> 1768StringFormat? stringFormat, 1774/// <inheritdoc cref="MeasureString(string?, Font, SizeF, StringFormat?, out int, out int)"/> 1779StringFormat? stringFormat, 1789StringFormat? stringFormat, 1827/// <inheritdoc cref="MeasureString(string?, Font, SizeF, StringFormat?)"/> 1828public SizeF MeasureString(string? text, Font font, PointF origin, StringFormat? stringFormat) 1832/// <inheritdoc cref="MeasureString(string?, Font, PointF, StringFormat?)"/> 1833public SizeF MeasureString(ReadOnlySpan<char> text, Font font, PointF origin, StringFormat? stringFormat) 1837/// <inheritdoc cref="MeasureString(string?, Font, SizeF, StringFormat?)"/> 1846/// <see cref="StringFormat"/> that represents formatting information, such as line spacing, for the text. 1851/// <inheritdoc cref="MeasureString(string?, Font, int, StringFormat?)"/> 1852public SizeF MeasureString(string? text, Font font, SizeF layoutArea, StringFormat? stringFormat) => 1856/// <inheritdoc cref="MeasureString(string?, Font, SizeF, StringFormat?)"/> 1857public SizeF MeasureString(ReadOnlySpan<char> text, Font font, SizeF layoutArea, StringFormat? stringFormat) => 1878/// use the <see cref="MeasureCharacterRanges(string?, Font, RectangleF, StringFormat?)"/> method or one of 1879/// the <see cref="MeasureString(string?, Font, int, StringFormat?)"/> methods that takes a StringFormat, and 1880/// pass <see cref="StringFormat.GenericTypographic"/>. Also, ensure the <see cref="TextRenderingHint"/> for 1903/// <see cref="StringFormat"/> that represents formatting information, such as line spacing, for the text. 1906public SizeF MeasureString(string? text, Font font, int width, StringFormat? format) => 1910/// <inheritdoc cref="MeasureString(string?, Font, int, StringFormat?)"/> 1911public SizeF MeasureString(ReadOnlySpan<char> text, Font font, int width, StringFormat? format) => 1923/// <see cref="StringFormat"/> that represents formatting information, such as line spacing, for the text. 1936public Region[] MeasureCharacterRanges(string? text, Font font, RectangleF layoutRect, StringFormat? stringFormat) => 1940/// <inheritdoc cref="MeasureCharacterRanges(string?, Font, RectangleF, StringFormat?)"/> 1941public Region[] MeasureCharacterRanges(ReadOnlySpan<char> text, Font font, RectangleF layoutRect, StringFormat? stringFormat) => 1949StringFormat? stringFormat)
System\Drawing\PointerExtensions.cs (1)
15public static GpStringFormat* Pointer(this StringFormat? format) => format is null ? null : format._nativeFormat;
System\Drawing\StringFormat.cs (20)
20/// Initializes a new instance of the <see cref='StringFormat'/> class. 27/// Initializes a new instance of the <see cref='StringFormat'/> class with the specified <see cref='StringFormatFlags'/>. 34/// Initializes a new instance of the <see cref='StringFormat'/> class with the specified 45/// Initializes a new instance of the <see cref='StringFormat'/> class from the specified 46/// existing <see cref='StringFormat'/>. 48public StringFormat(StringFormat format) 58/// Cleans up Windows resources for this <see cref='StringFormat'/>. 97/// Creates an exact copy of this <see cref='StringFormat'/>. 190/// Gets or sets the <see cref='HotkeyPrefix'/> for this <see cref='StringFormat'/> . 214/// Sets tab stops for this <see cref='StringFormat'/>. 240/// Gets the tab stops for this <see cref='StringFormat'/>. 268/// Gets or sets the <see cref='StringTrimming'/> for this <see cref='StringFormat'/>. 292/// Gets a generic default <see cref='StringFormat'/>. 306public static StringFormat GenericDefault 317/// Gets a generic typographic <see cref='StringFormat'/>. 332public static StringFormat GenericTypographic 353/// Gets the <see cref='StringDigitSubstitute'/> for this <see cref='StringFormat'/>. 371/// Gets the language of <see cref='StringDigitSubstitute'/> for this <see cref='StringFormat'/>. 393/// Cleans up Windows resources for this <see cref='StringFormat'/>. 398/// Converts this <see cref='StringFormat'/> to a human-readable string.
System.Drawing.Common.Tests (79)
mono\System.Drawing\GraphicsTests.cs (12)
1652using StringFormat string_format = new(); 1683using StringFormat string_format = new(); 1716using StringFormat string_format = new(); 1747using StringFormat string_format = new(); 1894using StringFormat string_format = new(); 1917using StringFormat string_format = new(); 1961using StringFormat string_format = new(); 2008using StringFormat format = StringFormat.GenericTypographic; 2085using StringFormat fmt = new(); 2102using StringFormat fmt = new(); 2119using StringFormat format = new();
mono\System.Imaging\MetafileTest.cs (1)
311StringFormat sf = new()
System\Drawing\Drawing2D\GraphicsPathTests.cs (19)
995gpi.AddString("mono", FontFamily.GenericMonospace, 0, 10, new Point(10, 10), StringFormat.GenericDefault); 998gpf.AddString("mono", FontFamily.GenericMonospace, 0, 10, new PointF(10f, 10f), StringFormat.GenericDefault); 1007gpi.AddString("mono", FontFamily.GenericMonospace, 0, 10, new Rectangle(10, 10, 10, 10), StringFormat.GenericDefault); 1010gpf.AddString("mono", FontFamily.GenericMonospace, 0, 10, new RectangleF(10f, 10f, 10f, 10f), StringFormat.GenericDefault); 1019gpi.AddString("mono", FontFamily.GenericMonospace, 0, -10, new Point(10, 10), StringFormat.GenericDefault); 1023gpi.AddString("mono", FontFamily.GenericMonospace, 0, -10, new Rectangle(10, 10, 10, 10), StringFormat.GenericDefault); 1026gpf.AddString("mono", FontFamily.GenericMonospace, 0, -10, new PointF(10f, 10f), StringFormat.GenericDefault); 1030gpf.AddString("mono", FontFamily.GenericMonospace, 0, -10, new RectangleF(10f, 10f, 10f, 10f), StringFormat.GenericDefault); 1043gp2.AddString("mono", FontFamily.GenericMonospace, 0, 10, new RectangleF(10f, 10f, 10f, 10f), StringFormat.GenericDefault); 1046gp3.AddString("mono", FontFamily.GenericMonospace, 0, 10, new RectangleF(10f, 10f, 10f, 10f), StringFormat.GenericTypographic); 1055gpi.AddString(string.Empty, FontFamily.GenericMonospace, 0, 10, new Point(10, 10), StringFormat.GenericDefault); 1058gpi.AddString(string.Empty, FontFamily.GenericMonospace, 0, 10, new PointF(10f, 10f), StringFormat.GenericDefault); 1067gp.AddString(null, FontFamily.GenericMonospace, 0, 10, new Point(10, 10), StringFormat.GenericDefault)); 1069gp.AddString(null, FontFamily.GenericMonospace, 0, 10, new PointF(10f, 10f), StringFormat.GenericDefault)); 1071gp.AddString(null, FontFamily.GenericMonospace, 0, 10, new Rectangle(10, 10, 10, 10), StringFormat.GenericDefault)); 1073gp.AddString(null, FontFamily.GenericMonospace, 0, 10, new RectangleF(10f, 10f, 10f, 10f), StringFormat.GenericDefault)); 1081new GraphicsPath().AddString("mono", null, 0, 10, new Point(10, 10), StringFormat.GenericDefault)); 1636gp.AddString("mono", FontFamily.GenericMonospace, 0, 10, new Point(20, 20), StringFormat.GenericDefault); 1979gp.AddString("Mono::", FontFamily.GenericMonospace, 0, 10, new Point(10, 10), StringFormat.GenericDefault);
System\Drawing\StringFormatTests.cs (47)
16using StringFormat format = new(); 31using StringFormat format = new(options); 47using StringFormat format = new(options, language); 60using StringFormat original = new(StringFormatFlags.NoClip, EnglishLanguageCode); 61using StringFormat format = new(original); 84StringFormat format = new(); 93StringFormat format = new(); 101using StringFormat original = new(StringFormatFlags.NoClip, EnglishLanguageCode); 102using StringFormat format = Assert.IsType<StringFormat>(original.Clone()); 119StringFormat format = new(); 132using StringFormat format = new(); 141StringFormat format = new(); 152using StringFormat format = new(); 162using StringFormat format = new(); 169using StringFormat format = new(); 176using StringFormat format = new(); 183StringFormat format = new(); 192StringFormat format = new(); 210using StringFormat format = new(); 217using StringFormat format = new(); 224using StringFormat format = new(); 231StringFormat format = new(); 243using StringFormat format = new() { Alignment = alignment }; 252using StringFormat format = new(); 259StringFormat format = new(); 269StringFormat format = new(); 278StringFormat format = new(); 290using StringFormat format = new() { FormatFlags = formatFlags }; 297StringFormat format = new(); 310using StringFormat format = new() { LineAlignment = alignment }; 319using StringFormat format = new(); 326StringFormat format = new(); 339using StringFormat format = new() { HotkeyPrefix = prefix }; 348using StringFormat format = new(); 355StringFormat format = new(); 366using StringFormat format = new() { Trimming = trimming }; 375using StringFormat format = new(); 382StringFormat format = new(); 392StringFormat format = StringFormat.GenericDefault; 393Assert.NotSame(format, StringFormat.GenericDefault); 407StringFormat format = StringFormat.GenericTypographic; 408Assert.NotSame(format, StringFormat.GenericTypographic); 422using StringFormat format = new(StringFormatFlags.DirectionVertical); 429StringFormat format = new(StringFormatFlags.DirectionVertical);
System.Windows.Forms (25)
System\Windows\Forms\Controls\Buttons\ButtonBase.cs (1)
1012internal virtual StringFormat CreateStringFormat()
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.cs (4)
86/// Get <see cref="StringFormat"/> object for rendering text using GDI+ (<see cref="Graphics"/>). 88internal virtual StringFormat CreateStringFormat() 461using StringFormat stringFormat = CreateStringFormat(); 619using StringFormat format = Control.CreateStringFormat();
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.LayoutOptions.cs (3)
70public StringFormat StringFormat 74StringFormat format = new() 669using StringFormat stringFormat = StringFormat;
System\Windows\Forms\Controls\DataGridView\DataGridView.cs (1)
266private StringFormat? _placeholderStringFormat;
System\Windows\Forms\Controls\GroupBox\GroupBox.cs (1)
474using StringFormat format = new StringFormat
System\Windows\Forms\Controls\Labels\Label.cs (3)
910internal virtual StringFormat CreateStringFormat() 1081using StringFormat stringFormat = CreateStringFormat(); 1282using StringFormat stringFormat = CreateStringFormat();
System\Windows\Forms\Controls\Labels\LinkLabel.cs (6)
528using StringFormat textFormat = CreateStringFormat(); 601internal override StringFormat CreateStringFormat() 603StringFormat stringFormat = base.CreateStringFormat(); 1124StringFormat stringFormat = CreateStringFormat(); 1293StringFormat stringFormat = CreateStringFormat(); 1352StringFormat stringFormat = CreateStringFormat();
System\Windows\Forms\Controls\ListBoxes\CheckedListBox.cs (1)
634using StringFormat format = new();
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridEntry.cs (1)
1594StringFormat stringFormat = new(StringFormatFlags.NoWrap)
System\Windows\Forms\Printing\PrintPreviewControl.cs (1)
603using StringFormat format = new()
System\Windows\Forms\Rendering\ControlPaint.cs (3)
1946StringFormat format) 2528internal static StringFormat CreateStringFormat( 2534StringFormat stringFormat = new()
System.Windows.Forms.Design (6)
System\ComponentModel\Design\CollectionEditor.CollectionEditorCollectionForm.cs (1)
605using (StringFormat format = new())
System\ComponentModel\Design\MultilineStringEditor.MultilineStringEditorUI.cs (1)
25private readonly StringFormat _watermarkFormat;
System\Drawing\Design\FontNameEditor.cs (1)
74StringFormat format = new(StringFormatFlags.NoWrap | StringFormatFlags.NoFontFallback)
System\Windows\Forms\Design\ComponentTray.cs (1)
2279StringFormat format = new();
System\Windows\Forms\Design\ControlDesigner.cs (1)
2244StringFormat stringFormat = new StringFormat
System\Windows\Forms\Design\ToolStripCollectionEditor.ToolStripItemEditorForm.cs (1)
871StringFormat stringFormat = null;
System.Windows.Forms.Tests (1)
System\Windows\Forms\ControlPaintTests.cs (1)
1917RectangleF layoutRectangle, StringFormat format)
WinFormsControlsTest (1)
ListBoxes.cs (1)
50e.Font, customBrush, e.Bounds, StringFormat.GenericDefault);