Custom Object Properties Page: Enter and Escape Key

Hi all,

I tested the sample provided by Dale for adding custom properties page. (
I added a DataGridView component inside the user control to display user text on objects. However, the DataGridView does not respond to enter and escape keys while editing a cell. The normal behavior is that enter finishes the edit and escape cancels the edit.

I tried to use EditingControlShowing in DataGridView to subscribe to the KeyDown event, but the event is not firing for enter and escape key. All the other keys are firing the event. I tried override ProcessCmdKey in SampleCsObjectPropertiesPageControl, but still the enter and escape is not firing the event.

I would like to know how I can make the enter and escape keys work properly?


You might see if this helps:


Thanks. This works.

I think it would be helpful to add this to the sample:
The key that is pressed can be retrieved by adding the following line to LocalWindowsHook_HookInvoked method:
var wParam = (uint)Marshal.ReadInt32(e.lParam, Marshal.OffsetOf(typeof(WindowsInterop.MSG), “wParam”).ToInt32());