private void TxtreturnList_SelectedIndexChanged(object sender, EventArgs e) { int s = Int32.Parse(txtreturnList.SelectedItem.ToString()); for (int i = 0; i <= Korean.Items.Count - 1; i++) { if (i == s) { Korean.SetSelected(i, true); break; } } }
private void TxtSearch_TextChanged(object sender, EventArgs e) { string myString = txtSearch.Text; bool found = false; for (int i = 0; i <= Korean.Items.Count - 1; i++) { if (Korean.Items[i].ToString().Contains(myString)) { Korean.SetSelected(i, true); found = true; break; } } }
private void TextBox1_TextChanged(object sender, EventArgs e) { try { txtreturnList.Items.Clear(); string s = (from d in Translations where d.Value == textBox1.Text select d.Key).FirstOrDefault(); for (int i = 0; i <= Korean.Items.Count - 1; i++) { if (Korean.Items[i].ToString().Contains(s)) { Korean.SetSelected(i, true); txtreturnList.Items.Add(i); break; } } } catch { } }