//This is called from the passwordbox private void Grid_KeyUp(object sender, KeyEventArgs e) { //If enter is pressed whilst using passwordbox if (e.Key == Key.Enter) { CreateNew.PerformClick(); } }