60 references to One
System.Windows.Forms (13)
System\Windows\Forms\Controls\ListBoxes\CheckedListBox.cs (1)
195if (value is not SelectionMode.One and not SelectionMode.None)
System\Windows\Forms\Controls\ListBoxes\ListBox.AccessibleObject.cs (1)
41&& owner.SelectionMode != SelectionMode.One
System\Windows\Forms\Controls\ListBoxes\ListBox.cs (9)
69private SelectionMode _selectionMode = SelectionMode.One; 71private SelectionMode _cachedSelectionMode = SelectionMode.One; 320case SelectionMode.One: 837if (current == SelectionMode.One && IsHandleCreated) 859if (_selectionMode == SelectionMode.One && value != -1) 989[DefaultValue(SelectionMode.One)] 1637if (_selectionMode == SelectionMode.One) 1665case SelectionMode.One: 1793if (_selectedItems.Count > 0 && _selectionMode == SelectionMode.One)
System\Windows\Forms\Controls\ListBoxes\ListBox.ItemAccessibleObject.cs (1)
187|| _owningListBox.SelectionMode == SelectionMode.One
System\Windows\Forms\Controls\ListBoxes\ListBox.SelectedObjectCollection.cs (1)
44case SelectionMode.One:
System.Windows.Forms.Design (1)
System\ComponentModel\Design\CollectionEditor.CollectionEditorCollectionForm.cs (1)
430_listBox.SelectionMode = (CanSelectMultipleInstances() ? SelectionMode.MultiExtended : SelectionMode.One);
System.Windows.Forms.Tests (46)
CheckedListBoxTests.cs (1)
93[InlineData(SelectionMode.One)]
System\Windows\Forms\AccessibleObjects\ListBoxAccessibleObjectTests.cs (3)
160[InlineData(SelectionMode.One, true)] 181[InlineData(SelectionMode.One, false)] 314using ListBox listBox = new() { SelectionMode = multipleSelection ? SelectionMode.MultiExtended : SelectionMode.One };
System\Windows\Forms\ListBoxTests.cs (42)
116Assert.Equal(SelectionMode.One, control.SelectionMode); 296[InlineData(SelectionMode.One, 0x562100C1)] 2323[InlineData(SelectionMode.One)] 2351SelectionMode = SelectionMode.One 2494SelectionMode = SelectionMode.One 2621SelectionMode = SelectionMode.One 2676[InlineData(SelectionMode.One)] 2786[InlineData(SelectionMode.One, null)] 2789[InlineData(SelectionMode.One, "item")] 2817SelectionMode = SelectionMode.One 2985SelectionMode = SelectionMode.One 3134SelectionMode = SelectionMode.One 3200[InlineData(SelectionMode.One)] 3447control.SelectionMode = SelectionMode.One; 3448Assert.Equal(SelectionMode.One, control.SelectionMode); 3483control.SelectionMode = SelectionMode.One; 3484Assert.Equal(SelectionMode.One, control.SelectionMode); 3507control.SelectionMode = SelectionMode.One; 3508Assert.Equal(SelectionMode.One, control.SelectionMode); 3516control.SelectionMode = SelectionMode.One; 3517Assert.Equal(SelectionMode.One, control.SelectionMode); 3580[InlineData(SelectionMode.One, 0)] 3620yield return new object[] { SelectionMode.None, SelectionMode.One, 1 }; 3625yield return new object[] { SelectionMode.MultiExtended, SelectionMode.One, 1 }; 3630yield return new object[] { SelectionMode.MultiSimple, SelectionMode.One, 1 }; 3632yield return new object[] { SelectionMode.One, SelectionMode.None, 1 }; 3633yield return new object[] { SelectionMode.One, SelectionMode.MultiExtended, 1 }; 3634yield return new object[] { SelectionMode.One, SelectionMode.MultiSimple, 1 }; 3635yield return new object[] { SelectionMode.One, SelectionMode.One, 0 }; 3720control.SelectionMode = SelectionMode.One; 3721Assert.Equal(SelectionMode.One, control.SelectionMode); 3772control.SelectionMode = SelectionMode.One; 3773Assert.Equal(SelectionMode.One, control.SelectionMode); 3806control.SelectionMode = SelectionMode.One; 3807Assert.Equal(SelectionMode.One, control.SelectionMode); 3818control.SelectionMode = SelectionMode.One; 3819Assert.Equal(SelectionMode.One, control.SelectionMode); 4143foreach (SelectionMode selectionMode in new SelectionMode[] { SelectionMode.MultiExtended, SelectionMode.MultiSimple, SelectionMode.One }) 4191foreach (SelectionMode selectionMode in new SelectionMode[] { SelectionMode.MultiExtended, SelectionMode.MultiSimple, SelectionMode.One }) 4202yield return new object[] { formattingEnabled, SelectionMode.One, "item2", "item2", 1 }; 6335[InlineData(SelectionMode.One)]