Guest User

Untitled

a guest
Apr 22nd, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. private void txtSearch_TextChanged(object sender, EventArgs e)
  2. {
  3. AutoCompleteStringCollection result = new AutoCompleteStringCollection();
  4.  
  5. //do my logic too add the list of items to result
  6. txtSearch.AutoCompleteCustomSource = result;
  7. }
  8.  
  9. private void txtSearch_keypress(object sender, KeyPressEventArgs e)
  10. {
  11. if (e.KeyChar ==(char)( Keys.Enter))
  12. {
  13. cmdSearch.PerformClick();
  14. e.Handled = true;
  15.  
  16. }
  17.  
  18. }
  19.  
  20. this.txtSearch.KeyPress += new KeyPressEventHandler(this.txtSearch_keypress);
Add Comment
Please, Sign In to add comment