This is a migrated thread and some comments may be shown as answers.

Shortcut in inactive window

3 Answers 92 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ole
Top achievements
Rank 1
Ole asked on 14 Aug 2012, 09:40 AM
When we assign shortcuts to a RadMenuItem in a context menu on a form, the shortcut is also triggered when the form is not active.

The shortcut is working properly when the form is active, but when the form shows a modal dialog on top, the shortcut from the underlaying window is still active and can be triggered.

How can we change this behaviour?

3 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 16 Aug 2012, 04:15 PM
Hello Ole,

Thank you for contacting Telerik support.

This is the default behavior of our context menus and it cannot be modified. You can avoid this with explicit check if the form is active in the item click event, for example:

void radMenuItem1_Click(object sender, EventArgs e)
{
            if (!this.Focused)
            {
                return;
            }
 
            MessageBox.Show("Click");
}

Do not hesitate to contact us if you have other questions.

Greetings,

Peter
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
0
Ole
Top achievements
Rank 1
answered on 16 Aug 2012, 05:58 PM
Thank you for the answer, the solution will fix the problem. But it is slightly confusing, as the following link to the dokumentation states that RadItem shortcuts only are executed when the for is active. Maybe the documentation needs to be fixed. http://www.telerik.com/help/winforms/shortcuts-assigning-global-radshortcuts.html
0
Peter
Telerik team
answered on 17 Aug 2012, 10:12 AM
Hi Ole,

Yes, you are correct - this is not valid for RadMenuItems placed in the RadContextMenu. ContextMenus behave differently, because they are components and actually are not members of the form Controls collection.

We will consider updating our documentation. Thank you for the cooperation.

All the best,
Peter
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
Tags
General Discussions
Asked by
Ole
Top achievements
Rank 1
Answers by
Peter
Telerik team
Ole
Top achievements
Rank 1
Share this question
or