Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
3455
ProcessCmdKey while DockableControlPane floating
posted

Hi,

I have a form which have WinDockManager. In this form I am overriding ProcessCmdKey method.

My issue is if the DockableControlPane is in floating the key events are not obtained (ProcessCmdKey is not invoked).

Regards,

Ceaser

  • 44743
    Suggested Answer
    posted

    I have reproduced this, but only when a control on the floating pane is active. When a control on the main Form is active, ProcessCmdKey gets called correctly. I believe this is correct as it looks like ProcessCmdKey only gets called on the parent chain of the active control.

    Here is how you can make this work in your application: Move the logic from your Form's ProcessCmdKey override to a helper method, called something like ProcessCmdKeyHelper. Then define a custom control class which overrides ProcessCmdKey. In that override, also call off to ProcessCmdKeyHelper on the Form. Instead of docking your docked controls, dock instances of this custom control. Then place your docked controls in these custom controls and set their Dock properties to Fill.