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
145
UltraToolbarsManager responding to shortcut keys in another form
posted

Is there any reason why an UltraToolbarsManager.ToolClick event would be fired in Form1 if the user presses a shortcut key combination in another form, Form2?

It appears to me that this happens only when Form2 is owned by Form1 (i.e., the instance of Form2 is created and displayed in Form1, and Form1 then executes "this.AddOwnedForm(Form2) ". 

There is no relationship between the ultraToolbarsManager in Form2 and the ultraToolbarsManager in Form1 (e.g. Form2 has its own ultraToolbarsManager with its own tools and own shortcut keys). 

Form2 definitely has focus when the keystroke is entered -- Form2's KeyDown event is fired before Form1's ultraToolbarsManager ToolClick event.

If this behaviour is intended, what is the best way to have Form1's ultraToolbarsManager ignore keystrokes entered in another form?

We are using version 7.1.

Thanks,

 Dan.

  • 44743
    posted

    Yes, this is intended behavior. The owning form's toolbars manager processes the shortcut key message first. If it does not use it, then owned forms will be given the opportunity to process the message. This is so controls on toolbars or dock manager panes in your application do not get the first crack at the key message when they are floating and second crack at it when they are docked.

    To have the toolbars manager on the owner form ignore a shortcut, handle the BeforeShortcutKeyProcessed event and set Cancel on the event args to True.