67 references to None
System.Windows.Forms (22)
System\Windows\Forms\Controls\ListBoxes\CheckedListBox.cs (7)
195if (value is not SelectionMode.One and not SelectionMode.None) 581Color backColor = (SelectionMode != SelectionMode.None) ? e.BackColor : BackColor; 582Color foreColor = (SelectionMode != SelectionMode.None) ? e.ForeColor : ForeColor; 594if (SelectionMode != SelectionMode.None && (e.State & DrawItemState.Selected) == DrawItemState.Selected) 717Color backColor = (SelectionMode != SelectionMode.None) ? e.BackColor : BackColor; 728Color foreColor = (SelectionMode != SelectionMode.None) ? e.ForeColor : ForeColor; 777if (e.KeyChar == ' ' && SelectionMode != SelectionMode.None)
System\Windows\Forms\Controls\ListBoxes\ListBox.AccessibleObject.cs (2)
37=> this.IsOwnerHandleCreated(out ListBox? owner) && owner.SelectionMode != SelectionMode.None; 42&& owner.SelectionMode != SelectionMode.None;
System\Windows\Forms\Controls\ListBoxes\ListBox.cs (11)
311case SelectionMode.None: 810return _selectionMode != SelectionMode.None; 832if (current == SelectionMode.None) 854if (_selectionMode == SelectionMode.None) 1062if (SelectionMode != SelectionMode.None && SelectedItem is not null) 1084if (SelectionMode != SelectionMode.None && value is not null && (SelectedItem is null || !value.Equals(GetItemText(SelectedItem)))) 1635Debug.Assert(_selectionMode != SelectionMode.None, "Guard against setting selection for None selection mode outside this code."); 1784if (_selectionMode != SelectionMode.None) 1937if (SelectionMode != SelectionMode.None && DataManager is not null) 2007if (SelectionMode != SelectionMode.None) 2149if (_selectionMode == SelectionMode.None)
System\Windows\Forms\Controls\ListBoxes\ListBox.ItemAccessibleObject.cs (1)
186|| _owningListBox.SelectionMode == SelectionMode.None
System\Windows\Forms\Controls\ListBoxes\ListBox.SelectedObjectCollection.cs (1)
41case SelectionMode.None:
System.Windows.Forms.Tests (45)
CheckedListBoxTests.cs (1)
92[InlineData(SelectionMode.None)]
System\Windows\Forms\AccessibleObjects\ListBoxAccessibleObjectTests.cs (2)
161[InlineData(SelectionMode.None, false)] 182[InlineData(SelectionMode.None, false)]
System\Windows\Forms\ListBoxTests.cs (42)
295[InlineData(SelectionMode.None, 0x562140C1)] 2751SelectionMode = SelectionMode.None 3263SelectionMode = SelectionMode.None 3274SelectionMode = SelectionMode.None 3465control.SelectionMode = SelectionMode.None; 3466Assert.Equal(SelectionMode.None, control.SelectionMode); 3474control.SelectionMode = SelectionMode.None; 3475Assert.Equal(SelectionMode.None, control.SelectionMode); 3549control.SelectionMode = SelectionMode.None; 3550Assert.Equal(SelectionMode.None, control.SelectionMode); 3558control.SelectionMode = SelectionMode.None; 3559Assert.Equal(SelectionMode.None, control.SelectionMode); 3577[InlineData(SelectionMode.None, 1)] 3617yield return new object[] { SelectionMode.None, SelectionMode.None, 0 }; 3618yield return new object[] { SelectionMode.None, SelectionMode.MultiExtended, 1 }; 3619yield return new object[] { SelectionMode.None, SelectionMode.MultiSimple, 1 }; 3620yield return new object[] { SelectionMode.None, SelectionMode.One, 1 }; 3622yield return new object[] { SelectionMode.MultiExtended, SelectionMode.None, 1 }; 3627yield return new object[] { SelectionMode.MultiSimple, SelectionMode.None, 1 }; 3632yield return new object[] { SelectionMode.One, SelectionMode.None, 1 }; 3748control.SelectionMode = SelectionMode.None; 3749Assert.Equal(SelectionMode.None, control.SelectionMode); 3760control.SelectionMode = SelectionMode.None; 3761Assert.Equal(SelectionMode.None, control.SelectionMode); 3864control.SelectionMode = SelectionMode.None; 3865Assert.Equal(SelectionMode.None, control.SelectionMode); 3876control.SelectionMode = SelectionMode.None; 3877Assert.Equal(SelectionMode.None, control.SelectionMode); 4136yield return new object[] { formattingEnabled, SelectionMode.None, null, string.Empty, -1 }; 4137yield return new object[] { formattingEnabled, SelectionMode.None, string.Empty, string.Empty, -1 }; 4138yield return new object[] { formattingEnabled, SelectionMode.None, "NoSuchItem", "NoSuchItem", -1 }; 4139yield return new object[] { formattingEnabled, SelectionMode.None, "item1", "item1", -1 }; 4140yield return new object[] { formattingEnabled, SelectionMode.None, "ITEM1", "ITEM1", -1 }; 4141yield return new object[] { formattingEnabled, SelectionMode.None, "item2", "item2", -1 }; 4184yield return new object[] { formattingEnabled, SelectionMode.None, null, string.Empty, -1 }; 4185yield return new object[] { formattingEnabled, SelectionMode.None, string.Empty, string.Empty, -1 }; 4186yield return new object[] { formattingEnabled, SelectionMode.None, "NoSuchItem", "NoSuchItem", -1 }; 4187yield return new object[] { formattingEnabled, SelectionMode.None, "item1", "item1", -1 }; 4188yield return new object[] { formattingEnabled, SelectionMode.None, "ITEM1", "ITEM1", -1 }; 4189yield return new object[] { formattingEnabled, SelectionMode.None, "item2", "item2", -1 }; 6324listBox.SelectionMode = SelectionMode.None;