我有一个具有撤消功能的控件,当用户按下 Escape 时,控件将恢复原始值。
问题是当我将控件集成到 DataGridView 时。DataGridView “吃掉” Escape 键,因此我的控件无法检测到 Escape 键。
当我在 EditingControlWantsInputKey 上设置“return true”时,我的控件能够检测到 Escape 键,但出现了其他问题,DataGridView 无法关闭我的控件,它停留在 EditMode。
如何让我的控件检测 Escape 键同时还允许 DataGridView 关闭我的控件?