Am I missing something obvious?
I can't get keyboard shortcuts to work with RadButtons.
With standard VB buttons you could just set the shortcut key by prefixing the desired letter with the '&' and it would show as underlined and the button could be activated by pressing <ALT> + desired letter.
The RadButtons are showing the underscore for the desired letter but nothing triggers when <ALT> + letter pressed.
How can I achieve this basic Windows functionality?
Any pointers much apprieciated
Many Thanks
Steve
11 Answers, 1 is accepted
It sound like you are doing things correctly. All RadButtons, RadCheckBosx, RadRadioButtons and RadToggleButton support mnemonics. The fact that you have the first letter underlined shows that you have mnemonics set to true (default for RadButton)
I can only suggest pointing you to this documentation link.
I have tried it in a new project with a couple of RadButtons on the form and all worked fine. Are there any special circumstances to your application that may affect it?
thanks
Richard
Thanks for the response.
We have tried it on a few forms and at the moment it appears to work only for forms shown modally. It does not work at all for any forms that are mdi children.
Also just tried it on a patch (2009 Q2 SP1) for the version we are using and it appears to work ok on all forms. We are looking into updating to that as it also seems to sort some other issues we had (do you recall the mdi child list Window menu issue I had), wondering if this is something to do with a fix in it regarding mdi child form activation as we created our own mdi 'Window' menu item but it didn't always detect when a form got focus/was active.
The problem we have with updating to SP1 is that it is currently changing the layout of some of the controls that are anchored (I think it corrects a previous anchoring problem)
Thanks
Steve
For reference, I'm using the latest Q3 2010 Version. There are lots of enhancements and fixes in the later version. Especially around RadGridView and some excellent performance fixes too. I've just tried a MDI Form with 2 MDI Children and I can use the keyboard shortcuts on whichever MDI Child is hte active one without any issue.
It could be something to do with your other issue, but I don't have an od version of hte controls to try this out with. Hope it helps that I've tried it for you in the latest and if you need anyhting else, just let me know.
Thanks
Richard
Thank you for writing.
I have tested your scenario with Q2 2009 and it works fine at my end. For this reason, I would like to ask you to open a new ticket, where you can attach your project. This will allow us to investigate this case further and provide you with accurate support.
Additionally, I would like to inform you that as of Q2 2010 we have introduced new shortcut mechanism (RadShortcut) which introduces many improvements. It also supports the so called "Global Shortcuts" which might help in your case. More information can be found at this link.
Greetings,
Stefan
the Telerik team
I am using RadButtonElement and I want to add shortcut So I add below code
MyRadButtonElement .Shortcuts.Add(new RadShortcut(Keys.Control, Keys.S));
but it does not work while it works for RadButton correctly
what did I miss ? let me know
Thanks
Regards
Fariba
Can you please provide more information on how do you use the button element? I have tested this with a button element in RadRibbonBar and it works as expected on my end.
Meanwhile, you can have a look at our online documentation on the matter: http://www.telerik.com/help/winforms/shortcuts-getting-started-().html.
Regards,
Stefan
Telerik
Hi Stefan,
I add Button Element in RadRibbonBarGroup and I do the same as
this.radButton1.ButtonElement.Shortcuts.Add(new RadShortcut(Keys.Control, Keys.B));
My code is
RadButtonElement btnSave=new Telerik.WinControls.UI.RadButtonElement();
btnSave.Shortcuts.Add(new RadShortcut(Keys.Control, Keys.S));​
According to Online Telerik Help the Second line is enough for adding Shortcuts but Unfortunately It does not work
Let me Know what did I wrong
Thank You
Regards,
Fariba
This is what I have too and it works correctly. I am testing with our latest version:
protected
override
void
OnLoad(EventArgs e)
{
base
.OnLoad(e);
RadButtonElement button =
new
RadButtonElement();
button.Text =
"I am a button element"
;
button.Click += btn_Click;
((radRibbonBar1.CommandTabs[0]
as
RibbonTab).Items[0]
as
RadRibbonBarGroup).Items.Add(button);
button.Shortcuts.Add(
new
RadShortcut(Keys.Control, Keys.B));
}
void
btn_Click(
object
sender, EventArgs e)
{
RadMessageBox.Show(
"test"
);
}
Should you still experience issues, I would suggest that you open new support ticket where you can provide us with your project, so we can investigate it.
Regards,
Stefan
Telerik
Hi Stefan
I rechecked my code and this problem happens becuse the RadRibbonBarGroup is added to a MDIParent form
and ​I send shortcuts from ​MDIchilde so it does not work
What should I do?How Can I send a shortcuts From MDIChild to Parent?
Thank you
Regards,
Fariba
In this case, you should use global shortcuts. Information on the matter is available here: http://www.telerik.com/help/winforms/shortcuts-assigning-global-radshortcuts.html.
Regards,
Stefan
Telerik
Thank you ,Stefan
It works
Regards,
Fariba