C# IComPropertyPage escape/enter key handling

Discussion created by lpugh01 on Jun 23, 2010
Latest reply on Jun 24, 2010 by jamesfreddyc
I'm using ArcGIS 9.3.1 SP1.

I have a class that implements UserControl and IComPropertyPage in C# .NET. The UserControl contains several controls including a DataGridView. One of the DataGridView columns is an editable text column. When editing the text in a textbox, the normal behavior is that Escape cancels the edit, and Enter commits it.

However it appears that the ESRI Property Sheet code takes priority and whenever Escape or Enter are pressed, the window closes regardless of whether I am editing the text or not. I have tried setting keydown/previewkeydown event handlers, overriding WndProc and looking for key messages there, etc., but they never fire, in every case the property sheet closes before any of my code has a chance to run.

Has anyone else run into this issue and come up with any solution or workaround?

Thanks in advance.