diff options
author | Karl <5079870+PreferLinux@users.noreply.github.com> | 2020-01-28 18:31:18 +0300 |
---|---|---|
committer | Alexander Köplinger <alex.koeplinger@outlook.com> | 2020-01-28 18:31:18 +0300 |
commit | 2fdafcf3a4fdf2a558667b4b594b6f40169b3afa (patch) | |
tree | 7bb343476042bd2a38a355a68bf75395aa7988d2 /mcs/class | |
parent | c191dba87dee8d8bd25ed3d7247ae47a782cc1c6 (diff) |
Don't select ListBox item if SelectionMode == None (#18492)
When the user types a letter or digit, KeySearch looks for and selects
an item starting with that character. However, it should not if
SelectionMode is None.
Diffstat (limited to 'mcs/class')
-rw-r--r-- | mcs/class/System.Windows.Forms/System.Windows.Forms/ListBox.cs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ListBox.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ListBox.cs index fbc74eed38d..b513cf90910 100644 --- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ListBox.cs +++ b/mcs/class/System.Windows.Forms/System.Windows.Forms/ListBox.cs @@ -1614,7 +1614,7 @@ namespace System.Windows.Forms private bool KeySearch (Keys key) { char c = (char) key; - if (!Char.IsLetterOrDigit (c)) + if (!Char.IsLetterOrDigit (c) || SelectionMode == SelectionMode.None) return false; int idx = FindString (c.ToString (), SelectedIndex); |