Ribbon button has initial button selected

Ribbon for WPF Forum

Posted 13 years ago by Mick
Version: 11.1.0542
Platform: .NET 4.0
Environment: Windows Vista (32-bit)
Avatar
I manually add items to my PopupButton on the ribbon, and when the popup shows, the first item is selected (highlighted).

Steps to reproduce:

1) Create a new WPF window and copy this code, modifying class names / namespaces as needed

<Window
    x:Class="RibbonSamples.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:ribbon="http://schemas.actiprosoftware.com/winfx/xaml/ribbon"
    Height="480"
    Width="640"
    >
    <Grid>
        <DockPanel>
            <ribbon:Ribbon>
                <ribbon:Tab Label="Tab">
                    <ribbon:Group Label="Group">
                        <ribbon:PopupButton Label="Button">
                            <ribbon:PopupButton.PopupContent>
                                <StackPanel>
                                    <ribbon:Button Label="Button 1" />
                                    <ribbon:Separator />
                                    <ribbon:Button Label="Button 2" />
                                </StackPanel>
                            </ribbon:PopupButton.PopupContent>
                        </ribbon:PopupButton>
                    </ribbon:Group>
                </ribbon:Tab>
            </ribbon:Ribbon>
        </DockPanel>
    </Grid>
</Window>
2) Run the project and click the button on the ribbon.

---

Result: "Button 1" is initially selected (I don't think it should be - correct me if I'm mistaken or if I caused this by not using the controls correctly)

Thank you,
Mick

Comments (3)

Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Mick,

Perhaps your intention was to use a <ribbon:Menu> in place of your <StackPanel> block? Try that out.


Actipro Software Support

Posted 13 years ago by Mick
Avatar
Thank you, this works for now.

Is there any way to get a ribbon button to show in a non-themed stack/menu (like what shows during the run of the application in my post above)? The Actipro menu has a space for an icon, and I don't want to use an icon for some menus.

Mick
Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Well you can do what you had, but the problem probably is that the button is getting keyboard focus and thus has the highlight, making it appear selected.


Actipro Software Support

The latest build of this product (v24.1.1) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.