Posted 15 years ago by Matt Swanton
Avatar
Hi,

When I put a PopupButton inside a WPF Toolbar it does not have the same 'toolbar' style that is normally applied to standard buttons.

I'm aware that this behaviour exists for buttons inside UserControls but you can use the following code to tell the button to use the toolbar style...

Style ButtonStyle = (Style)FindResource(ToolBar.ButtonStyleKey);
myButton.Style = ButtonStyle;
... but this does not work for the PopupButton, as even though the style is applied the drop down arrow disappears.

Is there anything I can do to make the PopupButton use the toolbar style?

Many thanks in advance
Matt Swanton

Comments (6)

Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Matt,

We do not currently have Styles (or associated ControlTemplates) defined for the PopupButton for use in the ToolBar. If you are an existing customer, we can provide the Styles for the PopupButton (just send an email to our support address). Using these, and the native Button toolbar Style, you can style it appropriately.

Regardless, I've put this on our TODO list.


Actipro Software Support

Posted 15 years ago by Jeff Key
Avatar
Could someone provide an example? I've been fortunate to not have to deal w/Styles in my few months with WPF and don't know where to start..

Thanks,
Jeff
Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Jeff,

If you are an existing customer, we'll be happy to email you the styles for popup button. Just email our support address for them.

If you own the WPF Studio suite, you can download them directly from your account.


Actipro Software Support

Posted 15 years ago by Jeff Key
Avatar
Hello,

I have the styles; I was looking for a sample on how I might use them to make the PopupButtons look like the other buttons when used in a toolbar.

Not a big deal, but it would be nice to have since we could use them in a couple of our toolbars.

Thanks!
Jeff
Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Oh sorry, we don't have those at this time. But if you have the default styles for PopupButton, maybe grab the default styles for the native WPF controls as well. Then look at how Button is styled for a toolbar and use most of that template in a new PopupButton template. That's essentially what we'd do.


Actipro Software Support

Posted 15 years ago by Jeff Key
Avatar
That should work -- thanks.
The latest build of this product (v24.1.1) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.