Access Key not working for the ribbon

Ribbon for WPF Forum

Posted 1 month ago by Kevin Hur - CNC Software, Inc.
Version: 21.1.2
Avatar

Hello, I have a question regarding the implementation of the access key

I wrote the following code

<ribbon:Button
x:Uid="NewButton"
KeyTipAccessText="N"
AutomationProperties.AutomationId="NewButton"
Label="{x:Static res:Resources.NewButtonLabel}"
Height="25"
Width="100"
HorizontalContentAlignment="Center"
ScreenTipDescription="{x:Static res:Resources.NewTip}"
Command="{Binding Path=NewCommand}" />

But the access key is 

1. Not working when I press ALT + N

2. Not showing up when I am in access key mode (Pressed ALT to see all the other shortcuts

Am I implementing something incorrectly or missing something?

Comments (5)

Posted 1 month ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Kevin,

Are you using this button within the Ribbon, or standalone outside of the Ribbon?  Note that key tips will not work outside of the Ribbon.


Actipro Software Support

Posted 1 month ago by Kevin Hur - CNC Software, Inc.
Avatar

Oh, I am using outside of the ribbon. But when you say key tips will not work oustide of the Ribbon, do you mean no matter what implementation, key tips will not work if the button is outside of the Ribbon?

Also, when trying to wrap the button with a ribbon, I am getting an error saying that

A value of type 'Button' cannot be added to a collection or dictionary of type 'RibbonControlCollection`1'.

<ribbon:Ribbon>
<ribbon:Button
x:Uid="NewButton"
AutomationProperties.AutomationId="NewButton"
Label="{x:Static res:Resources.NewButtonLabel}"
Height="25"
Width="100"
HorizontalContentAlignment="Center"
ScreenTipDescription="{x:Static res:Resources.NewTip}"
Command="{Binding Path=NewCommand}" />
</ribbon:Ribbon>

[Modified 1 month ago]

Posted 1 month ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Kevin,

That is correct, the Ribbon itself watches key events and checks to see if any key tips match at the current key tip scope level.  Thus any controls outside the Ribbon won't have key tip support.

There is a structure to Ribbon that is required.  The Ribbon can only contain Tabs, Tabs can only contain Groups, and Groups can contain things like Buttons.


Actipro Software Support

Posted 1 month ago by Kevin Hur - CNC Software, Inc.
Avatar

I see, is it possible to have the ribbon put in the ribbon, tab, groups, but make it all invisible except for the buttons?

I am having particular trouble getting rid of the quick access bar and making the background color (except the buttons) to be visibility of none, since that includes the buttons as well.

Posted 1 month ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

Unfortunately not.  Can you provide some detailed information about your usage scenario and perhaps we can provide a user interface suggestion? 

For instance, is there a reason you are using ribbon:Button outside of the Ribbon instead of using a normal WPF Button?


Actipro Software Support

The latest build of this product (v21.1.3) was released 16 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.