38 references to MeasureText
System.Windows.Forms (16)
System\Windows\Forms\Controls\Buttons\Button.cs (1)
96Size requiredSize = TextRenderer.MeasureText(Text, Font);
System\Windows\Forms\Controls\Buttons\CheckBox.cs (1)
283Size textSize = TextRenderer.MeasureText(Text, Font);
System\Windows\Forms\Controls\Buttons\RadioButton.cs (1)
254Size textSize = TextRenderer.MeasureText(Text, Font);
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxCell.cs (1)
606Size preferredSize = TextRenderer.MeasureText(comboBox.GetItemText(item), comboBox.Font);
System\Windows\Forms\Controls\ListView\DrawListViewColumnHeaderEventArgs.cs (1)
142int padding = TextRenderer.MeasureText(" ", Font).Width;
System\Windows\Forms\Controls\ListView\DrawListViewItemEventArgs.cs (1)
104Size textSize = TextRenderer.MeasureText(subItem.Text, subItem.Font);
System\Windows\Forms\Controls\ListView\DrawListViewSubItemEventArgs.cs (1)
140int padding = TextRenderer.MeasureText(" ", font).Width;
System\Windows\Forms\Controls\ListView\ListViewItem.IKeyboardToolTip.cs (3)
114new Size(Math.Min(TextRenderer.MeasureText(item.Text, item.Font).Width, itemBounds.Width), 123int textWidth = TextRenderer.MeasureText(item.Text, item.Font).Width; 128textWidth = Math.Max(TextRenderer.MeasureText(subItem.Text, subItem.Font).Width, textWidth);
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownMenu.cs (1)
295_tabWidth = TextRenderer.MeasureText("\t", Font).Width;
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.cs (1)
2351_cachedTextSize = TextRenderer.MeasureText(Text, Font);
System\Windows\Forms\Controls\ToolStrips\ToolStripMenuItem.cs (1)
734_cachedShortcutSize = TextRenderer.MeasureText(shortcutString, Font);
System\Windows\Forms\Controls\TreeView\TreeView.cs (1)
2828Size textSize = TextRenderer.MeasureText(node.Text, node.TreeView!.Font);
System\Windows\Forms\Controls\UpDown\NumericUpDown.cs (2)
813int textWidth = TextRenderer.MeasureText(GetNumberText(testNumber), Font).Width; 821int shortTextWidth = TextRenderer.MeasureText(shortText, Font).Width;
System.Windows.Forms.Design (2)
System\ComponentModel\Design\CollectionEditor.SplitButton.cs (1)
62if (_showSplit && !string.IsNullOrEmpty(Text) && TextRenderer.MeasureText(Text, Font).Width + PushButtonWidth > preferredSize.Width)
System\Windows\Forms\Design\DataGridViewColumnCollectionDialog.cs (1)
1160int itemWidth = TextRenderer.MeasureText(_selectedColumns.Items[i].ToString(), _selectedColumns.Font).Width;
System.Windows.Forms.Tests (20)
System\Windows\Forms\ButtonTests.cs (13)
599Size newSize = TextRenderer.MeasureText(control.Text, control.Font); 696Size oldSize = TextRenderer.MeasureText(control.Text, control.Font); 700Size newSize = TextRenderer.MeasureText(control.Text, font); 951Size oldSize = TextRenderer.MeasureText(control.Text, control.Font); 955Size newSize = TextRenderer.MeasureText("NewText", control.Font); 1338Size minSize = TextRenderer.MeasureText(control.Text, control.Font); 1362Size minSize = TextRenderer.MeasureText(control.Text, control.Font); 1634Size minSize = TextRenderer.MeasureText(control.Text, control.Font); 1658Size minSize = TextRenderer.MeasureText(control.Text, control.Font); 1682Size minSize = TextRenderer.MeasureText(control.Text, control.Font); 1706Size minSize = TextRenderer.MeasureText(control.Text, control.Font); 1730Size minSize = TextRenderer.MeasureText(control.Text, control.Font); 1754Size minSize = TextRenderer.MeasureText(control.Text, control.Font);
System\Windows\Forms\ListViewItem.IKeyboardToolTipTests.cs (2)
184? TextRenderer.MeasureText(listViewItem.Text, listViewItem.Font).Width 200? TextRenderer.MeasureText(listViewSubItem.Text, listViewSubItem.Font).Width
System\Windows\Forms\TextRendererTests.cs (3)
404Size result = TextRenderer.MeasureText(text, font); 409Assert.Equal(result, TextRenderer.MeasureText(text, font)); 519Assert.Equal(Size.Empty, TextRenderer.MeasureText(text, SystemFonts.MenuFont));
TextBoxBaseTests.cs (2)
5085int width = TextRenderer.MeasureText(control.Text, control.Font).Width; 5105int width = TextRenderer.MeasureText(control.Text, control.Font).Width;