Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void txtSearch_TextChanged(object sender, EventArgs e)
- {
- AutoCompleteStringCollection result = new AutoCompleteStringCollection();
- //do my logic too add the list of items to result
- txtSearch.AutoCompleteCustomSource = result;
- }
- private void txtSearch_keypress(object sender, KeyPressEventArgs e)
- {
- if (e.KeyChar ==(char)( Keys.Enter))
- {
- cmdSearch.PerformClick();
- e.Handled = true;
- }
- }
- this.txtSearch.KeyPress += new KeyPressEventHandler(this.txtSearch_keypress);
Add Comment
Please, Sign In to add comment