private ComboBoxItemAccessibleObject?GetSelectedComboBoxItemAccessibleObject() { // We should use the SelectedIndex property instead of the SelectedItem to avoid the problem of getting // the incorrect item when the list contains duplicate items https://github.com/dotnet/winforms/issues/3590 int selectedIndex = _owningComboBox.SelectedIndex; if (selectedIndex < 0 || selectedIndex > _owningComboBox.Items.Count - 1) { return(null); } Entry selectedItem = _owningComboBox.Entries[selectedIndex]; return(ItemAccessibleObjects.GetComboBoxItemAccessibleObject(selectedItem)); }
internal void ResetListItemAccessibleObjects() { ItemAccessibleObjects.Clear(); }