void searchBox2_SearchClick(object sender, EventArgs e) { searchBox2.Box.Items.Clear(); int i; string text = searchBox2.Box.Text; if (int.TryParse(searchBox2.Box.Text, out i)) { ChatListSubItem[] nums = FriendList.GetSubItemsByDisplayName((id) => { return(id == text); }); searchBox2.Box.Items.AddRange(nums); } ChatListSubItem[] items = FriendList.GetSubItemsByNickName ((item) => { return(item.IndexOf(text) > -1); }); searchBox2.Box.Items.AddRange(items); if (searchBox2.Box.Items.Count > 0) { searchBox2.Box.SelectedIndex = 0; FriendList.SelectSubItem = (ChatListSubItem)searchBox2.Box.Items[0]; } }