void textBox_KeyDown(object sender, KeyEventArgs e) { // Search if the user presses the enter key on the search box if (e.Key == Key.Enter) Search(); }