43 references to GetItemText
System.Windows.Forms (26)
System\Windows\Forms\Controls\ComboBox\ComboBox.ComboBoxItemAccessibleObject.cs (1)
141public override string? Name => _owningComboBox is null ? base.Name : _owningComboBox.GetItemText(_owningItem.Item);
System\Windows\Forms\Controls\ComboBox\ComboBox.cs (6)
848strings[i] = GetItemText(Items[i])!; 1087string? candidate = GetItemText(SelectedItem); 1124|| string.Compare(value, GetItemText(selectedItem), ignoreCase: false, CultureInfo.CurrentCulture) != 0) 2160int insertIndex = (int)PInvokeCore.SendMessage(this, PInvoke.CB_ADDSTRING, (WPARAM)0, GetItemText(item)); 2211int insertIndex = (int)PInvokeCore.SendMessage(this, PInvoke.CB_INSERTSTRING, (WPARAM)index, GetItemText(item)); 3434s = GetItemText(item);
System\Windows\Forms\Controls\ComboBox\ComboBox.ObjectCollection.cs (3)
421if (string.Compare(_owner.GetItemText(value), _owner.NativeGetItemText(index), true, CultureInfo.CurrentCulture) != 0) 471string? itemName1 = _owner.GetItemText(entry1.Item); 472string? itemName2 = _owner.GetItemText(entry2.Item);
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxCell.cs (1)
606Size preferredSize = TextRenderer.MeasureText(comboBox.GetItemText(item), comboBox.Font);
System\Windows\Forms\Controls\ListBoxes\CheckedListBox.cs (1)
592string? text = GetItemText(item);
System\Windows\Forms\Controls\ListBoxes\ListBox.cs (8)
1066return GetItemText(SelectedItem) ?? string.Empty; 1084if (SelectionMode != SelectionMode.None && value is not null && (SelectedItem is null || !value.Equals(GetItemText(SelectedItem)))) 1089if (string.Compare(value, GetItemText(Items[index]), true, CultureInfo.CurrentCulture) == 0) 1304strings[i] = GetItemText(Items[i]); 1534int insertIndex = (int)PInvokeCore.SendMessage(this, PInvoke.LB_ADDSTRING, 0, GetItemText(item)); 1589int insertIndex = (int)PInvokeCore.SendMessage(this, PInvoke.LB_INSERTSTRING, (uint)index, GetItemText(item)); 2216string? z = GetItemText(Items[0]); 2282width = (int)(Math.Ceiling(graphics.MeasureString(GetItemText(item), Font).Width));
System\Windows\Forms\Controls\ListBoxes\ListBox.ItemAccessibleObject.cs (1)
92public override string? Name => _owningListBox.GetItemText(_itemEntry.Item);
System\Windows\Forms\Controls\ListBoxes\ListBox.ObjectCollection.cs (1)
424if (string.Compare(_owner.GetItemText(value), _owner.NativeGetItemText(index), true, CultureInfo.CurrentCulture) != 0)
System\Windows\Forms\Controls\ListControl\ListControl.cs (2)
498found = string.Compare(str, GetItemText(items[index]), ignoreCase, CultureInfo.CurrentCulture) == 0; 502found = string.Compare(str, 0, GetItemText(items[index]), 0, str.Length, ignoreCase, CultureInfo.CurrentCulture) == 0;
System\Windows\Forms\Internal\ItemArray.cs (2)
306string? itemName1 = _listControl.GetItemText(entry1.Item); 307string? itemName2 = _listControl.GetItemText(entry2.Item);
System.Windows.Forms.Tests (17)
System\Windows\Forms\ListBoxTests.cs (1)
6278string result = listBox.GetItemText(listBox.SelectedItem);
System\Windows\Forms\ListControlTests.cs (16)
2380Assert.Equal(expected, control.GetItemText(item)); 2383Assert.Equal(expected, control.GetItemText(item)); 2419Assert.Equal(expected, control.GetItemText(item)); 2424Assert.Equal("3", control.GetItemText(item)); 2461Assert.Equal("3", control.GetItemText(item)); 2466Assert.Equal("3", control.GetItemText(item)); 2481Assert.Equal("custom", control.GetItemText(item)); 2484Assert.Equal("custom", control.GetItemText(item)); 2498Assert.Equal("10", control.GetItemText(item)); 2501Assert.Equal("10", control.GetItemText(item)); 2514Assert.Equal("10", control.GetItemText(item)); 2517Assert.Equal("10", control.GetItemText(item)); 2531Assert.Equal("NonCriticalThrowingTypeConverterDataClassToString", control.GetItemText(item)); 2534Assert.Equal("NonCriticalThrowingTypeConverterDataClassToString", control.GetItemText(item)); 2548Assert.Throws<StackOverflowException>(() => control.GetItemText(item)); 2551Assert.Throws<StackOverflowException>(() => control.GetItemText(item));