private void TxtKeysSearch_TextChanged(object sender, EventArgs e) { _fromCode = true; var ind = LstKeys.FindString(TxtKeysSearch.Text); LstKeys.SelectedIndex = ind; TxtKeysSearch.BackColor = ind == ListBox.NoMatches ? Color.Crimson : SystemColors.Window; }