private void frmProjects_Load(object sender, EventArgs e) { var ListMohandesin = (from item in _db.UserProfiles orderby item.Family select new { DisplayMember = item.Name + " " + item.Family, ValueMember = item.UserId }).ToList(); mcmbTMemary.DataSource = ListMohandesin; mcmbTMemary.DisplayMember = "DisplayMember"; mcmbTMemary.ValueMember = "ValueMember"; mcmbTMemary.SelectedIndex = -1; mcmbTMemary.AutoCompleteMode = AutoCompleteMode.SuggestAppend; mcmbTMemary.AutoCompleteSource = AutoCompleteSource.CustomSource; } private void mcmbTMemary_KeyPress(object sender, KeyPressEventArgs e) { mcmbTMemary.AutoCompleteCustomSource.OfType<string>().Where(a => a.ToLower().Contains(mcmbTMemary.Text.ToLower())).Any(); }
mcmbTMemary.Text.ToLower()
Any()
mcmbTMemary.AutoCompleteCustomSource.Where(a => a.ToLower().Contains(mcmbTMemary.Text.ToLower()))
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)