399 references to TextFormatFlags
System.Windows.Forms (378)
System\Windows\Forms\Controls\Buttons\ButtonBase.cs (2)
1081internal virtual TextFormatFlags CreateTextFormatFlags() 1086return TextFormatFlags.Default;
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.cs (3)
94/// Get <see cref="TextFormatFlags"/> for rendering text using GDI (<see cref="TextRenderer"/>). 96internal virtual TextFormatFlags CreateTextFormatFlags() 492TextFormatFlags formatFlags = CreateTextFormatFlags();
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.LayoutOptions.cs (5)
50public TextFormatFlags GdiTextFormatFlags { get; set; } = TextFormatFlags.WordBreak | TextFormatFlags.TextBoxControl; 100public TextFormatFlags TextFormatFlags => 101_disableWordWrapping ? GdiTextFormatFlags & ~TextFormatFlags.WordBreak : GdiTextFormatFlags;
System\Windows\Forms\Controls\Buttons\ButtonRenderer.cs (15)
65/// <inheritdoc cref="DrawButton(Graphics, Rectangle, string?, Font?, TextFormatFlags, Image, Rectangle, bool, PushButtonState)"/> 124/// <inheritdoc cref="DrawButton(Graphics, Rectangle, string?, Font?, TextFormatFlags, Image, Rectangle, bool, PushButtonState)"/> 128/// <inheritdoc cref="DrawButton(Graphics, Rectangle, string?, Font?, TextFormatFlags, Image, Rectangle, bool, PushButtonState)"/> 136TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter | TextFormatFlags.SingleLine, 141/// <inheritdoc cref="DrawButton(Graphics, Rectangle, string?, Font?, TextFormatFlags, Image, Rectangle, bool, PushButtonState)"/> 142public static void DrawButton(Graphics g, Rectangle bounds, string? buttonText, Font? font, TextFormatFlags flags, bool focused, PushButtonState state) 170/// <inheritdoc cref="DrawButton(Graphics, Rectangle, string?, Font?, TextFormatFlags, Image, Rectangle, bool, PushButtonState)"/> 197/// <inheritdoc cref="DrawButton(Graphics, Rectangle, string?, Font?, TextFormatFlags, Image, Rectangle, bool, PushButtonState)"/> 211TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter | TextFormatFlags.SingleLine, 225TextFormatFlags flags, 237TextFormatFlags flags,
System\Windows\Forms\Controls\Buttons\CheckBoxRenderer.cs (13)
49/// <inheritdoc cref="DrawCheckBox(Graphics, Point, Rectangle, string?, Font?, TextFormatFlags, Image, Rectangle, bool, CheckBoxState)"/> 83/// <inheritdoc cref="DrawCheckBox(Graphics, Point, Rectangle, string?, Font?, TextFormatFlags, Image, Rectangle, bool, CheckBoxState)"/> 97TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter | TextFormatFlags.SingleLine, 101/// <inheritdoc cref="DrawCheckBox(Graphics, Point, Rectangle, string?, Font?, TextFormatFlags, Image, Rectangle, bool, CheckBoxState)"/> 108TextFormatFlags flags, 118TextFormatFlags flags, 155/// <inheritdoc cref="DrawCheckBox(Graphics, Point, Rectangle, string?, Font?, TextFormatFlags, Image, Rectangle, bool, CheckBoxState)"/> 171TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter | TextFormatFlags.SingleLine, 186TextFormatFlags flags,
System\Windows\Forms\Controls\Buttons\RadioButtonRenderer.cs (14)
49/// <inheritdoc cref="DrawRadioButton(Graphics, Point, Rectangle, string?, Font?, TextFormatFlags, Image, Rectangle, bool, RadioButtonState)" /> 87/// <inheritdoc cref="DrawRadioButton(Graphics, Point, Rectangle, string?, Font?, TextFormatFlags, Image, Rectangle, bool, RadioButtonState)" /> 98TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter | TextFormatFlags.SingleLine, 102/// <inheritdoc cref="DrawRadioButton(Graphics, Point, Rectangle, string?, Font?, TextFormatFlags, Image, Rectangle, bool, RadioButtonState)" /> 109TextFormatFlags flags, 122TextFormatFlags flags, 155/// <inheritdoc cref="DrawRadioButton(Graphics, Point, Rectangle, string?, Font?, TextFormatFlags, Image, Rectangle, bool, RadioButtonState)" /> 171TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter | TextFormatFlags.SingleLine, 186TextFormatFlags flags, 209TextFormatFlags flags,
System\Windows\Forms\Controls\ComboBox\ComboBox.cs (5)
779Size textSize = TextRenderer.MeasureText(LayoutUtils.TestString, Font, new Size(short.MaxValue, (int)(FontHeight * 1.25)), TextFormatFlags.SingleLine); 790Size textSize = TextRenderer.MeasureText(LayoutUtils.TestString, Font, new Size(short.MaxValue, (int)(FontHeight * 1.25)), TextFormatFlags.SingleLine); 3814TextFormatFlags.Left | TextFormatFlags.VerticalCenter | TextFormatFlags.EndEllipsis);
System\Windows\Forms\Controls\ComboBox\ComboBoxRenderer.cs (4)
64DrawTextBox(g, bounds, comboBoxText, font, TextFormatFlags.TextBoxControl, state); 72DrawTextBox(g, bounds, comboBoxText, font, textBounds, TextFormatFlags.TextBoxControl, state); 78public static void DrawTextBox(Graphics g, Rectangle bounds, string? comboBoxText, Font? font, TextFormatFlags flags, ComboBoxState state) 90public static void DrawTextBox(Graphics g, Rectangle bounds, string? comboBoxText, Font? font, Rectangle textBounds, TextFormatFlags flags, ComboBoxState state)
System\Windows\Forms\Controls\DataGridView\DataGridViewButtonCell.cs (2)
301TextFormatFlags flags = DataGridViewUtilities.ComputeTextFormatFlagsForCellStyleAlignment(DataGridView.RightToLeftInternal, cellStyle.Alignment, cellStyle.WrapMode); 984TextFormatFlags flags = DataGridViewUtilities.ComputeTextFormatFlagsForCellStyleAlignment(
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (15)
19private const TextFormatFlags TextFormatSupportedFlags = TextFormatFlags.SingleLine 20| /*TextFormatFlags.NoFullWidthCharacterBreak |*/ TextFormatFlags.WordBreak | TextFormatFlags.NoPrefix; 2310TextFormatFlags flags = DataGridViewUtilities.ComputeTextFormatFlagsForCellStyleAlignment(rightToLeft, cellStyle.Alignment, cellStyle.WrapMode); 2513TextFormatFlags flags) => MeasureTextHeight( 2527TextFormatFlags flags, 2536throw new InvalidEnumArgumentException(nameof(flags), (int)flags, typeof(TextFormatFlags)); 2552TextFormatFlags flags) 2560throw new InvalidEnumArgumentException(nameof(flags), (int)flags, typeof(TextFormatFlags)); 2597TextFormatFlags flags) 2604throw new InvalidEnumArgumentException(nameof(flags), (int)flags, typeof(TextFormatFlags)); 2618TextFormatFlags flags) 2623if (oneLineSize.Height >= maxHeight || (flags & TextFormatFlags.SingleLine) != 0) 3947internal static bool TextFitsInBounds(Graphics graphics, string text, Font font, Size maxBounds, TextFormatFlags flags)
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnHeaderCell.cs (4)
500TextFormatFlags flags = DataGridViewUtilities.ComputeTextFormatFlagsForCellStyleAlignment(DataGridView.RightToLeftInternal, cellStyle.Alignment, cellStyle.WrapMode); 966TextFormatFlags flags = DataGridViewUtilities.ComputeTextFormatFlagsForCellStyleAlignment(DataGridView.RightToLeftInternal, cellStyle.Alignment, cellStyle.WrapMode); 971if ((flags & TextFormatFlags.SingleLine) != 0) 973flags |= TextFormatFlags.EndEllipsis;
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxCell.cs (5)
828return MeasureTextHeight(graphics, " ", cellStyle.Font!, int.MaxValue, TextFormatFlags.Default) + adjustment; 1176TextFormatFlags flags = DataGridViewUtilities.ComputeTextFormatFlagsForCellStyleAlignment(DataGridView.RightToLeftInternal, cellStyle.Alignment, cellStyle.WrapMode); 2312TextFormatFlags flags = DataGridViewUtilities.ComputeTextFormatFlagsForCellStyleAlignment(DataGridView.RightToLeftInternal, cellStyle.Alignment, cellStyle.WrapMode); 2317if ((flags & TextFormatFlags.SingleLine) != 0) 2319flags |= TextFormatFlags.EndEllipsis;
System\Windows\Forms\Controls\DataGridView\DataGridViewLinkCell.cs (4)
558TextFormatFlags flags = DataGridViewUtilities.ComputeTextFormatFlagsForCellStyleAlignment(DataGridView.RightToLeftInternal, cellStyle.Alignment, cellStyle.WrapMode); 956TextFormatFlags flags = DataGridViewUtilities.ComputeTextFormatFlagsForCellStyleAlignment( 1019if ((flags & TextFormatFlags.SingleLine) != 0) 1021flags |= TextFormatFlags.EndEllipsis;
System\Windows\Forms\Controls\DataGridView\DataGridViewRowHeaderCell.cs (4)
533TextFormatFlags flags = DataGridViewUtilities.ComputeTextFormatFlagsForCellStyleAlignment(DataGridView.RightToLeftInternal, cellStyle.Alignment, cellStyle.WrapMode); 851TextFormatFlags flags = DataGridViewUtilities.ComputeTextFormatFlagsForCellStyleAlignment(DataGridView.RightToLeftInternal, cellStyle.Alignment, cellStyle.WrapMode); 887if ((flags & TextFormatFlags.SingleLine) != 0) 889flags |= TextFormatFlags.EndEllipsis;
System\Windows\Forms\Controls\DataGridView\DataGridViewTextBoxCell.cs (5)
224TextFormatFlags flags = DataGridViewUtilities.ComputeTextFormatFlagsForCellStyleAlignment(DataGridView.RightToLeftInternal, cellStyle.Alignment, cellStyle.WrapMode); 410TextFormatFlags flags = DataGridViewUtilities.ComputeTextFormatFlagsForCellStyleAlignment(DataGridView.RightToLeftInternal, cellStyle.Alignment, cellStyle.WrapMode); 731TextFormatFlags flags = DataGridViewUtilities.ComputeTextFormatFlagsForCellStyleAlignment( 740if ((flags & TextFormatFlags.SingleLine) != 0) 742flags |= TextFormatFlags.EndEllipsis;
System\Windows\Forms\Controls\DataGridView\DataGridViewTopLeftHeaderCell.cs (4)
148TextFormatFlags flags = DataGridViewUtilities.ComputeTextFormatFlagsForCellStyleAlignment(DataGridView.RightToLeftInternal, cellStyle.Alignment, cellStyle.WrapMode); 318TextFormatFlags flags = DataGridViewUtilities.ComputeTextFormatFlagsForCellStyleAlignment(DataGridView.RightToLeftInternal, cellStyle.Alignment, cellStyle.WrapMode); 323if ((flags & TextFormatFlags.SingleLine) != 0) 325flags |= TextFormatFlags.EndEllipsis;
System\Windows\Forms\Controls\DataGridView\DataGridViewUtilities.cs (66)
36internal static TextFormatFlags ComputeTextFormatFlagsForCellStyleAlignment( 41TextFormatFlags tff; 45tff = TextFormatFlags.Top; 48tff |= TextFormatFlags.Right; 52tff |= TextFormatFlags.Left; 57tff = TextFormatFlags.Top | TextFormatFlags.HorizontalCenter; 60tff = TextFormatFlags.Top; 63tff |= TextFormatFlags.Left; 67tff |= TextFormatFlags.Right; 72tff = TextFormatFlags.VerticalCenter; 75tff |= TextFormatFlags.Right; 79tff |= TextFormatFlags.Left; 84tff = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter; 87tff = TextFormatFlags.VerticalCenter; 90tff |= TextFormatFlags.Left; 94tff |= TextFormatFlags.Right; 99tff = TextFormatFlags.Bottom; 102tff |= TextFormatFlags.Right; 106tff |= TextFormatFlags.Left; 111tff = TextFormatFlags.Bottom | TextFormatFlags.HorizontalCenter; 114tff = TextFormatFlags.Bottom; 117tff |= TextFormatFlags.Left; 121tff |= TextFormatFlags.Right; 126tff = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter; 132tff |= TextFormatFlags.SingleLine; 137tff |= TextFormatFlags.WordBreak; 140tff |= TextFormatFlags.NoPrefix; 141tff |= TextFormatFlags.PreserveGraphicsClipping; 144tff |= TextFormatFlags.RightToLeft; 159TextFormatFlags flags) 307TextFormatFlags flags, 316TextFormatFlags flags, 320if ((flags & TextFormatFlags.SingleLine) != 0) 325flags |= TextFormatFlags.EndEllipsis; 352TextFormatFlags flags, 359if ((flags & TextFormatFlags.RightToLeft) != 0) 444internal static bool ValidTextFormatFlags(TextFormatFlags flags) 447return (flags & ~(TextFormatFlags.Bottom | 448TextFormatFlags.Default | 449TextFormatFlags.EndEllipsis | 450TextFormatFlags.ExpandTabs | 451TextFormatFlags.ExternalLeading | 452TextFormatFlags.HidePrefix | 453TextFormatFlags.HorizontalCenter | 454TextFormatFlags.Internal | 455TextFormatFlags.Left | 456TextFormatFlags.ModifyString | 457TextFormatFlags.NoClipping | 458TextFormatFlags.NoFullWidthCharacterBreak | 459TextFormatFlags.NoPrefix | 460TextFormatFlags.PathEllipsis | 461TextFormatFlags.PrefixOnly | 462TextFormatFlags.PreserveGraphicsClipping | 463TextFormatFlags.PreserveGraphicsTranslateTransform | 464TextFormatFlags.Right | 465TextFormatFlags.RightToLeft | 466TextFormatFlags.SingleLine | 467TextFormatFlags.TextBoxControl | 468TextFormatFlags.Top | 469TextFormatFlags.VerticalCenter | 470TextFormatFlags.WordBreak | 471TextFormatFlags.WordEllipsis)) == 0;
System\Windows\Forms\Controls\GroupBox\GroupBox.cs (11)
411TextFormatFlags textFlags = TextFormatFlags.TextBoxControl | TextFormatFlags.WordBreak 412| TextFormatFlags.PreserveGraphicsTranslateTransform | TextFormatFlags.PreserveGraphicsClipping; 416textFlags |= TextFormatFlags.HidePrefix; 421textFlags |= (TextFormatFlags.Right | TextFormatFlags.RightToLeft); 514textSize = hdc.HDC.MeasureText(Text, hfont, new Size(textRectangle.Width, int.MaxValue), (TextFormatFlags)flags); 518hdc.HDC.DrawText(Text, hfont, textRectangle, ForeColor, (TextFormatFlags)flags); 528(TextFormatFlags)flags);
System\Windows\Forms\Controls\GroupBox\GroupBoxRenderer.cs (16)
78=> DrawGroupBox(g, bounds, groupBoxText, font, TextFormatFlags.Top | TextFormatFlags.Left, state); 90=> DrawGroupBox(g, bounds, groupBoxText, font, textColor, TextFormatFlags.Top | TextFormatFlags.Left, state); 100TextFormatFlags flags, 109TextFormatFlags flags, 131TextFormatFlags flags, 141TextFormatFlags flags, 172TextFormatFlags flags, 191if ((flags & TextFormatFlags.Right) == TextFormatFlags.Right) 219if ((flags & TextFormatFlags.Right) == TextFormatFlags.Right) 278TextFormatFlags flags) 294if ((flags & TextFormatFlags.Right) == TextFormatFlags.Right)
System\Windows\Forms\Controls\Labels\Label.cs (13)
911private TextFormatFlags CreateTextFormatFlags() 917private protected TextFormatFlags CreateTextFormatFlags(Size constrainingSize) 924TextFormatFlags flags = ControlPaint.CreateTextFormatFlags(this, TextAlign, AutoEllipsis, UseMnemonic); 932flags &= ~(TextFormatFlags.WordBreak | TextFormatFlags.TextBoxControl); 1072TextFormatFlags format = FlatStyle == FlatStyle.System ? TextFormatFlags.Default : CreateTextFormatFlags(proposedConstraints); 1109TextFormatFlags flags = CreateTextFormatFlags(); 1112if ((flags & TextFormatFlags.NoPadding) == TextFormatFlags.NoPadding) 1116else if ((flags & TextFormatFlags.LeftAndRightPadding) == TextFormatFlags.LeftAndRightPadding) 1293TextFormatFlags flags = CreateTextFormatFlags();
System\Windows\Forms\Controls\Labels\LinkLabel.cs (5)
561TextFormatFlags flags = CreateTextFormatFlags(clientSize); 568if ((flags & TextFormatFlags.NoPadding) == TextFormatFlags.NoPadding) 572else if ((flags & TextFormatFlags.LeftAndRightPadding) == TextFormatFlags.LeftAndRightPadding)
System\Windows\Forms\Controls\ListBoxes\CheckedListBox.cs (6)
688TextFormatFlags flags = TextFormatFlags.Default; 689flags |= TextFormatFlags.NoPrefix; 693flags |= TextFormatFlags.ExpandTabs; 699flags |= TextFormatFlags.RightToLeft; 700flags |= TextFormatFlags.Right;
System\Windows\Forms\Controls\ListView\DrawListViewColumnHeaderEventArgs.cs (6)
128TextFormatFlags flags = (hAlign == HorizontalAlignment.Left) ? TextFormatFlags.Left : 129((hAlign == HorizontalAlignment.Center) ? TextFormatFlags.HorizontalCenter : 130TextFormatFlags.Right); 131flags |= TextFormatFlags.WordEllipsis; 139public void DrawText(TextFormatFlags flags)
System\Windows\Forms\Controls\ListView\DrawListViewItemEventArgs.cs (2)
84public void DrawText() => DrawText(TextFormatFlags.Left); 89public void DrawText(TextFormatFlags flags)
System\Windows\Forms\Controls\ListView\DrawListViewSubItemEventArgs.cs (6)
124TextFormatFlags flags = (hAlign == HorizontalAlignment.Left) ? TextFormatFlags.Left : 125((hAlign == HorizontalAlignment.Center) ? TextFormatFlags.HorizontalCenter : 126TextFormatFlags.Right); 127flags |= TextFormatFlags.WordEllipsis; 135public void DrawText(TextFormatFlags flags)
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.MeasureTextHelper.cs (10)
29TextFormatFlags.PreserveGraphicsClipping | TextFormatFlags.PreserveGraphicsTranslateTransform); 39TextFormatFlags.PreserveGraphicsClipping 40| TextFormatFlags.PreserveGraphicsTranslateTransform 41| TextFormatFlags.LeftAndRightPadding 42| TextFormatFlags.WordBreak 43| TextFormatFlags.NoFullWidthCharacterBreak); 45public static TextFormatFlags GetTextRendererFlags() 46=> TextFormatFlags.PreserveGraphicsClipping | TextFormatFlags.PreserveGraphicsTranslateTransform;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridEntry.cs (1)
1935(TextFormatFlags)format | PropertyGrid.MeasureTextHelper.GetTextRendererFlags());
System\Windows\Forms\Controls\RichTextBox\RichTextBox.cs (4)
3455TextFormatFlags.Left 3456| TextFormatFlags.Top 3457| TextFormatFlags.WordBreak 3458| TextFormatFlags.EndEllipsis);
System\Windows\Forms\Controls\TabControl\TabRenderer.cs (8)
65TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter | TextFormatFlags.SingleLine, 72public static void DrawTabItem(Graphics g, Rectangle bounds, string? tabItemText, Font? font, TextFormatFlags flags, bool focused, TabItemState state) 114TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter | TextFormatFlags.SingleLine, 121public static void DrawTabItem(Graphics g, Rectangle bounds, string? tabItemText, Font? font, TextFormatFlags flags, Image image, Rectangle imageRectangle, bool focused, TabItemState state)
System\Windows\Forms\Controls\TextBox\TextBox.cs (12)
849TextFormatFlags flags = TextFormatFlags.NoPadding | TextFormatFlags.Top | TextFormatFlags.EndEllipsis; 854flags |= TextFormatFlags.RightToLeft; 858flags |= TextFormatFlags.HorizontalCenter; 862flags |= TextFormatFlags.Right; 866flags |= TextFormatFlags.Left; 873flags &= ~TextFormatFlags.RightToLeft; 877flags |= TextFormatFlags.HorizontalCenter; 881flags |= TextFormatFlags.Left; 885flags |= TextFormatFlags.Right;
System\Windows\Forms\Controls\TextBox\TextBoxBase.cs (4)
841TextFormatFlags format = TextFormatFlags.NoPrefix; 844format |= TextFormatFlags.SingleLine; 848format |= TextFormatFlags.WordBreak;
System\Windows\Forms\Controls\TextBox\TextBoxRenderer.cs (4)
53DrawTextBox(g, bounds, textBoxText, font, TextFormatFlags.TextBoxControl, state); 61DrawTextBox(g, bounds, textBoxText, font, textBounds, TextFormatFlags.TextBoxControl, state); 67public static void DrawTextBox(Graphics g, Rectangle bounds, string? textBoxText, Font? font, TextFormatFlags flags, TextBoxState state) 78public static void DrawTextBox(Graphics g, Rectangle bounds, string? textBoxText, Font? font, Rectangle textBounds, TextFormatFlags flags, TextBoxState state)
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.ToolStripItemInternalLayout.cs (6)
69public virtual TextFormatFlags TextFormat 82internal static TextFormatFlags ContentAlignmentToTextFormat(ContentAlignment alignment, bool rightToLeft) 84TextFormatFlags textFormat = TextFormatFlags.Default; 88textFormat |= TextFormatFlags.RightToLeft; 129layoutOptions.GdiTextFormatFlags = Owner.ShowKeyboardCues ? layoutOptions.GdiTextFormatFlags : layoutOptions.GdiTextFormatFlags | TextFormatFlags.HidePrefix;
System\Windows\Forms\Controls\ToolStrips\ToolStripItemTextRenderEventArgs.cs (3)
26TextFormatFlags format) 59TextFormat = (item.ShowKeyboardCues) ? TextFormat : TextFormat | TextFormatFlags.HidePrefix; 96public TextFormatFlags TextFormat { get; set; }
System\Windows\Forms\Controls\ToolStrips\ToolStripRenderer.cs (1)
902TextFormatFlags textFormat = e.TextFormat;
System\Windows\Forms\Controls\TreeView\TreeView.cs (2)
2835TextRenderer.DrawText(g, node.Text, font, bounds, color, TextFormatFlags.Default); 2842TextRenderer.DrawText(g, node.Text, font, bounds, color, TextFormatFlags.Default);
System\Windows\Forms\Dialogs\ThreadExceptionDialog.cs (1)
213textSize = Size.Ceiling(TextRenderer.MeasureText(messageText, Font, textSize, TextFormatFlags.WordBreak));
System\Windows\Forms\Layout\LayoutUtils.cs (1)
50Size textSize = TextRenderer.MeasureText(obj.ToString(), font, new Size(short.MaxValue, short.MaxValue), TextFormatFlags.SingleLine);
System\Windows\Forms\Layout\LayoutUtils.MeasureTextCache.cs (4)
29public Size GetTextSize(string? text, Font? font, Size proposedConstraints, TextFormatFlags flags) 99public bool TextRequiresWordBreak(string? text, Font? font, Size size, TextFormatFlags flags) 108private Size GetUnconstrainedSize(string? text, Font? font, TextFormatFlags flags) 115flags &= ~TextFormatFlags.WordBreak; // rip out the wordbreak flag
System\Windows\Forms\Rendering\ControlPaint.cs (18)
2042TextFormatFlags format) 2059TextFormatFlags format, 2557internal static TextFormatFlags ConvertAlignmentToTextFormat(ContentAlignment alignment) 2560TextFormatFlags flags = TextFormatFlags.Top | TextFormatFlags.Left; 2564flags |= TextFormatFlags.Bottom; 2568flags |= TextFormatFlags.VerticalCenter; 2573flags |= TextFormatFlags.Right; 2577flags |= TextFormatFlags.HorizontalCenter; 2640internal static TextFormatFlags CreateTextFormatFlags( 2647TextFormatFlags flags = ConvertAlignmentToTextFormat(alignment); 2652flags |= TextFormatFlags.WordBreak | TextFormatFlags.TextBoxControl; 2656flags |= TextFormatFlags.EndEllipsis; 2662flags |= TextFormatFlags.RightToLeft; 2668flags |= TextFormatFlags.NoPrefix; 2673flags |= TextFormatFlags.HidePrefix;
System\Windows\Forms\Rendering\TextExtensions.cs (5)
25private static (DRAW_TEXT_FORMAT Flags, TextPaddingOptions Padding) SplitTextFormatFlags(TextFormatFlags flags) 35TextPaddingOptions padding = flags.HasFlag(TextFormatFlags.LeftAndRightPadding) 37: flags.HasFlag(TextFormatFlags.NoPadding) 55TextFormatFlags flags, 215TextFormatFlags flags)
System\Windows\Forms\Rendering\TextRenderer.cs (49)
18internal const TextFormatFlags SkipAssertFlag = (TextFormatFlags)0x4000_0000; 74TextFormatFlags flags) 86/// <param name="flags">A bitwise combination of the <see cref="TextFormatFlags"/> values.</param> 89/// Thrown if <see cref="TextFormatFlags.ModifyString"/> is set. 97TextFormatFlags flags) 114TextFormatFlags flags) 127/// <param name="flags">A bitwise combination of the <see cref="TextFormatFlags"/> values.</param> 130/// Thrown if <see cref="TextFormatFlags.ModifyString"/> is set. 139TextFormatFlags flags) 204TextFormatFlags flags) 216/// <param name="flags">A bitwise combination of the <see cref="TextFormatFlags"/> values.</param> 219/// Thrown if <see cref="TextFormatFlags.ModifyString"/> is set. 227TextFormatFlags flags) 244TextFormatFlags flags) 257/// <param name="flags">A bitwise combination of the <see cref="TextFormatFlags"/> values.</param> 260/// Thrown if <see cref="TextFormatFlags.ModifyString"/> is set. 269TextFormatFlags flags) 286TextFormatFlags flags = TextFormatFlags.Default) 296TextFormatFlags flags = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter) 318TextFormatFlags flags) 328TextFormatFlags flags = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter) 352TextFormatFlags flags) 363TextFormatFlags flags) 369private static TextFormatFlags BlockModifyString(TextFormatFlags flags) 372if (flags.HasFlag(TextFormatFlags.ModifyString)) 392/// <see cref="DrawText(IDeviceContext, ReadOnlySpan{char}, Font?, Rectangle, Color, TextFormatFlags)"/> 393/// overloads that takes a <see cref="TextFormatFlags"/> parameter. For example, the default behavior of the 398/// <see cref="TextFormatFlags"/> parameter. For an example, see 399/// <see cref="MeasureText(IDeviceContext, string?, Font?, Size, TextFormatFlags)"/>. 421public static Size MeasureText(string? text, Font? font, Size proposedSize, TextFormatFlags flags) 437/// Thrown if <see cref="TextFormatFlags.ModifyString"/> is set. 439public static Size MeasureText(ReadOnlySpan<char> text, Font? font, Size proposedSize, TextFormatFlags flags) 483TextFormatFlags flags) 501/// Thrown if <see cref="TextFormatFlags.ModifyString"/> is set. 508TextFormatFlags flags) 515TextFormatFlags flags = TextFormatFlags.Bottom) 531TextFormatFlags flags = TextFormatFlags.Bottom) 602internal static ApplyGraphicsProperties GetApplyStateFlags(IDeviceContext deviceContext, TextFormatFlags textFormatFlags) 610if (textFormatFlags.HasFlag(TextFormatFlags.PreserveGraphicsClipping)) 615if (textFormatFlags.HasFlag(TextFormatFlags.PreserveGraphicsTranslateTransform))
System\Windows\Forms\ToolTip\DrawToolTipEventArgs.cs (5)
84DrawText(TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter 85| TextFormatFlags.SingleLine | TextFormatFlags.HidePrefix); 91public void DrawText(TextFormatFlags flags)
System\Windows\Forms\VisualStyles\VisualStyleRenderer.cs (5)
365DrawText(dc, bounds, textToDraw, drawDisabled, TextFormatFlags.HorizontalCenter); 371public void DrawText(IDeviceContext dc, Rectangle bounds, string? textToDraw, bool drawDisabled, TextFormatFlags flags) 379internal void DrawText(HDC dc, Rectangle bounds, string? textToDraw, bool drawDisabled, TextFormatFlags flags) 658public unsafe Rectangle GetTextExtent(IDeviceContext dc, string textToDraw, TextFormatFlags flags) 681public unsafe Rectangle GetTextExtent(IDeviceContext dc, Rectangle bounds, string textToDraw, TextFormatFlags flags)
System.Windows.Forms.Design (21)
System\ComponentModel\Design\CollectionEditor.SplitButton.cs (5)
197TextFormatFlags formatFlags = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter; 224formatFlags |= TextFormatFlags.NoPrefix; 228formatFlags |= TextFormatFlags.HidePrefix;
System\Windows\Forms\Design\DesignBindingPicker.cs (6)
1851TextFormatFlags formatFlags = 1852TextFormatFlags.WordBreak | 1853TextFormatFlags.EndEllipsis | 1854TextFormatFlags.TextBoxControl | 1855TextFormatFlags.PreserveGraphicsClipping | 1856TextFormatFlags.PreserveGraphicsTranslateTransform;
System\Windows\Forms\Design\SplitterPanelDesigner.cs (2)
194TextRenderer.DrawText(g, name, drawFont, new Point(watermarkX, watermarkY), waterMarkTextColor, TextFormatFlags.PreserveGraphicsClipping | TextFormatFlags.PreserveGraphicsTranslateTransform);
System\Windows\Forms\Design\ToolStripCollectionEditor.ToolStripItemEditorForm.cs (8)
780TextFormatFlags format = TextFormatFlags.Top | TextFormatFlags.Left; 897TextFormatFlags flags = TextFormatFlags.EndEllipsis | TextFormatFlags.PreserveGraphicsTranslateTransform | TextFormatFlags.PreserveGraphicsClipping; 900flags |= TextFormatFlags.RightToLeft;