When one works in WinForms designer, you can click on a child control to select it. When you then hit the Esc key, the selection moves up to the parent control. If you press Esc key again, the next parent control up gets selected, until finally one reaches the form itself.
I have a user control with various child controls and have configured it for design-time support. When I click on a permitted child control it gets selected. When I press Esc key, however nothing happens. How, do I trap the Esc key at design time and move selection up to the parent control?
KeyPress
event toFocus()
some other object? Probably the parent controlKeyPress
event would do the trick withForm1.Focus();
. You just need to activate theKeyPreview
property onForm1
for it to work properly. I'm not sure neither am i near VS to test it, that's why i didn't post as answer. – Fernando Silva