19 references to MeasureText
System.Windows.Forms (15)
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.LayoutOptions.cs (1)
677textSize = TextRenderer.MeasureText(Text, Font, proposedSize, TextFormatFlags);
System\Windows\Forms\Controls\ComboBox\ComboBox.cs (2)
774Size textSize = TextRenderer.MeasureText(LayoutUtils.TestString, Font, new Size(short.MaxValue, (int)(FontHeight * 1.25)), TextFormatFlags.SingleLine); 785Size textSize = TextRenderer.MeasureText(LayoutUtils.TestString, Font, new Size(short.MaxValue, (int)(FontHeight * 1.25)), TextFormatFlags.SingleLine);
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (4)
2552Size requiredSize = TextRenderer.MeasureText(text, font, new Size(maxWidth, int.MaxValue), flags); 2591textSize = TextRenderer.MeasureText(text, font, new Size((int)maxWidth, int.MaxValue), flags); 2620return TextRenderer.MeasureText(text, font, new Size(int.MaxValue, int.MaxValue), flags); 2647textSize = TextRenderer.MeasureText(text, font, new Size((int)maxWidth, maxHeight), flags);
System\Windows\Forms\Controls\DataGridView\DataGridViewUtilities.cs (2)
322Size sizeRequired = TextRenderer.MeasureText(text, font, new Size(int.MaxValue, int.MaxValue), flags); 330Size sizeConstraint = TextRenderer.MeasureText(text, font, sizeCell, flags);
System\Windows\Forms\Controls\Labels\LinkLabel.cs (1)
559Size textSize = TextRenderer.MeasureText(text, alwaysUnderlined, clientSize, flags);
System\Windows\Forms\Controls\TextBox\TextBoxBase.cs (1)
850Size textSize = TextRenderer.MeasureText(Text, Font, proposedConstraints, format);
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 (2)
78Size 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)
460Size result = TextRenderer.MeasureText(text, font, proposedSize, flags); 465Assert.Equal(result, TextRenderer.MeasureText(text, font, proposedSize, flags)); 521Assert.Equal(Size.Empty, TextRenderer.MeasureText(text, SystemFonts.MenuFont, new Size(300, 400), TextFormatFlags.Default));
TextBoxBaseTests.cs (1)
5128int width = TextRenderer.MeasureText(control.Text, control.Font, Size.Empty, TextFormatFlags.SingleLine).Width;