29 references to MeasureString
System.Drawing.Common.Tests (15)
mono\System.Drawing\GraphicsTests.cs (14)
1575SizeF size = g.MeasureString(null, _font); 1577size = g.MeasureString(string.Empty, _font); 1583size = g.MeasureString(null, null); 1585size = g.MeasureString(string.Empty, null); 1596Assert.Throws<ArgumentNullException>(() => g.MeasureString("a", null)); 1782SizeF size = useSpan ? g.MeasureString(s.AsSpan(), _font) : g.MeasureString(s, _font); 1805SizeF size = useSpan ? g.MeasureString(s.AsSpan(), _font) : g.MeasureString(s, _font); 1810SizeF expected = useSpan ? g.MeasureString(s.AsSpan(), _font) : g.MeasureString(s, _font); 1814size = useSpan ? g.MeasureString(s.AsSpan(), _font) : g.MeasureString(s, _font); 1820expected = useSpan ? g.MeasureString(s.AsSpan(), _font) : g.MeasureString(s, _font); 1822size = useSpan ? g.MeasureString(s.AsSpan(), _font) : g.MeasureString(s, _font); 1826size = useSpan ? g.MeasureString(s.AsSpan(), _font) : g.MeasureString(s, _font); 1833expected = useSpan ? g.MeasureString(s.AsSpan(), _font) : g.MeasureString(s, _font); 1837size = useSpan ? g.MeasureString(s.AsSpan(), _font) : g.MeasureString(s, _font);
mono\System.Imaging\MetafileTest.cs (1)
308SizeF size = g.MeasureString(text, test_font);
System.Windows.Forms (5)
System\Windows\Forms\Controls\ListBoxes\ListBox.cs (1)
2282width = (int)(Math.Ceiling(graphics.MeasureString(GetItemText(item), Font).Width));
System\Windows\Forms\Controls\ListView\ListView.cs (1)
5471int textWidth = Size.Ceiling(g.MeasureString(text, Font)).Width;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridEntry.cs (1)
1225_cacheItems.LastValueTextWidth = (int)graphics.MeasureString(text, font).Width;
System\Windows\Forms\Design\ComponentEditorForm.cs (1)
209int titleWidth = (int)graphics.MeasureString(title, Font).Width;
System\Windows\Forms\Form.cs (1)
3736float stringWidth = graphics.MeasureString(magicString, font).Width;
System.Windows.Forms.Design (9)
System\ComponentModel\Design\CollectionEditor.CollectionEditorCollectionForm.cs (4)
212SizeF sizeW = g.MeasureString(c.ToString(CultureInfo.CurrentCulture), _listBox.Font); 220SizeF size = g.MeasureString(GetDisplayText(item), _listBox.Font); 564SizeF sizeW = g.MeasureString(maxC.ToString(CultureInfo.CurrentCulture), _listBox.Font); 621int width = offset + (int)g.MeasureString(itemText, Font).Width;
System\ComponentModel\Design\MultilineStringEditor.MultilineStringEditorUI.cs (1)
363size = g.MeasureString(SR.MultilineStringEditorWatermark, Font);
System\Windows\Forms\Design\ComponentTray.cs (1)
1990Size sz = Size.Ceiling(gr.MeasureString(Text, Font));
System\Windows\Forms\Design\DataGridViewColumnTypeEditor.Picker.cs (1)
50width = Math.Max(width, Size.Ceiling(g.MeasureString(item.ToString(), _typesListBox.Font)).Width);
System\Windows\Forms\Design\SplitterPanelDesigner.cs (1)
192int watermarkX = rectangle.Width / 2 - (int)g.MeasureString(name, drawFont).Width / 2;
System\Windows\Forms\Design\TabOrder.cs (1)
256var sz = Size.Ceiling(graphics.MeasureString(str, font));