每当在组合框中按下Enter键时,我需要触发一个事件。这是一个WPF C# 4.0控件,我找不到一个特定的事件处理程序来做这个。我认为我错过了什么,因为这似乎是应该包含的东西。是否有预先存在的代码来完成这个任务?
我还尝试过:
private void comboBox1_SelectionChanged(
object sender,
SelectionChangedEventArgs e)
{
if (e.Equals(Key.Enter))
{
// Do Something
}
}