19 references to MeasureText
System.Windows.Forms (15)
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.LayoutOptions.cs (1)
677
textSize = TextRenderer.
MeasureText
(Text, Font, proposedSize, TextFormatFlags);
System\Windows\Forms\Controls\ComboBox\ComboBox.cs (2)
774
Size textSize = TextRenderer.
MeasureText
(LayoutUtils.TestString, Font, new Size(short.MaxValue, (int)(FontHeight * 1.25)), TextFormatFlags.SingleLine);
785
Size textSize = TextRenderer.
MeasureText
(LayoutUtils.TestString, Font, new Size(short.MaxValue, (int)(FontHeight * 1.25)), TextFormatFlags.SingleLine);
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (4)
2552
Size requiredSize = TextRenderer.
MeasureText
(text, font, new Size(maxWidth, int.MaxValue), flags);
2591
textSize = TextRenderer.
MeasureText
(text, font, new Size((int)maxWidth, int.MaxValue), flags);
2620
return TextRenderer.
MeasureText
(text, font, new Size(int.MaxValue, int.MaxValue), flags);
2647
textSize = TextRenderer.
MeasureText
(text, font, new Size((int)maxWidth, maxHeight), flags);
System\Windows\Forms\Controls\DataGridView\DataGridViewUtilities.cs (2)
322
Size sizeRequired = TextRenderer.
MeasureText
(text, font, new Size(int.MaxValue, int.MaxValue), flags);
330
Size sizeConstraint = TextRenderer.
MeasureText
(text, font, sizeCell, flags);
System\Windows\Forms\Controls\Labels\LinkLabel.cs (1)
559
Size textSize = TextRenderer.
MeasureText
(text, alwaysUnderlined, clientSize, flags);
System\Windows\Forms\Controls\TextBox\TextBoxBase.cs (1)
850
Size textSize = TextRenderer.
MeasureText
(Text, Font, proposedConstraints, format);
System\Windows\Forms\Dialogs\ThreadExceptionDialog.cs (1)
213
textSize = Size.Ceiling(TextRenderer.
MeasureText
(messageText, Font, textSize, TextFormatFlags.WordBreak));
System\Windows\Forms\Layout\LayoutUtils.cs (1)
50
Size textSize = TextRenderer.
MeasureText
(obj.ToString(), font, new Size(short.MaxValue, short.MaxValue), TextFormatFlags.SingleLine);
System\Windows\Forms\Layout\LayoutUtils.MeasureTextCache.cs (2)
78
Size prefSize = TextRenderer.
MeasureText
(text, font, proposedConstraints, flags);
116
_unconstrainedPreferredSize = TextRenderer.
MeasureText
(text, font, s_maxSize, flags);
System.Windows.Forms.Tests (4)
System\Windows\Forms\TextRendererTests.cs (3)
460
Size result = TextRenderer.
MeasureText
(text, font, proposedSize, flags);
465
Assert.Equal(result, TextRenderer.
MeasureText
(text, font, proposedSize, flags));
521
Assert.Equal(Size.Empty, TextRenderer.
MeasureText
(text, SystemFonts.MenuFont, new Size(300, 400), TextFormatFlags.Default));
TextBoxBaseTests.cs (1)
5128
int width = TextRenderer.
MeasureText
(control.Text, control.Font, Size.Empty, TextFormatFlags.SingleLine).Width;