标签:窗口 this com bsp wpf his pre close key
如何按ESC关闭窗口?
在InitializeComponent();下面增加KeyDown事件,如:
public ModifyPrice() { InitializeComponent(); this.KeyDown += ModifyPrice_KeyDown; } private void ModifyPrice_KeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Escape)//Esc键 { this.Close(); } }
标签:窗口 this com bsp wpf his pre close key
原文地址:http://www.cnblogs.com/theroad/p/6178633.html