I've just spent a very frustrating afternoon trawling Google looking for a commercial-grade WPF SplitButton
control that will work in a ToolBar
. A SplitButton
is one where you can click on the main part of the Button
to take a default action, or click on a little triangle on the right to get a drop-down menu of alternate actions).
I found several on the web (including the one on CodeProject, and including the two on CodePlex). None of them work properly in a ToolBar
--they either don't appear at all, or they don't have toolbar button styling. I even looked at some commercial offerings, like ActiPro's pop-up button (in their SharedLibrary DLL). Same problems.
And yes, I've seen all the posts about how easy it is to create one. It's very easy to create a bad one, but not so easy to create one that looks and works like the SplitButton
s in Outlook or Visual Studio, where the drop-down menu doesn't disappear if you release the mouse button.
So, here's my question: Are there any commercial-grade SplitButton
s out there, either open-source or commercial, that work in toolbars? I'm not looking for a control that is part of a $1,500 annual subscription to somebody's controls library, but if there is a reasonably-priced SplitButton
, I'd sure like to find it.
I was looking for the same and just rolled my own (you will need to style to your liking (to match the ToolBar) and you could refactor it / convert it into a custom control ... etc.)
The only true "commercial-grade" split button that I know of is the one by Syncfusion, which is included as part of their ribbon controls (although it works outside of the ribbon as well).
That being said, I remember this implementation as being fairly usable and complete, if you're looking for something free.
Using the WPF Toolkit split button to show a context menu is reasonably straight forward. Add a context menu in your window resources. On the window load - bind the context menu to the split button and then use the context menu as you would do normally.
It really needs to be added in the WPF Toolkit as the majority use case for this button is to replicate the old WinForm Splitt button.
Code behind:
The Extended WPF Toolkit Community Edition (which is free) has a nice
SplitButton
(and it has aDropDownButton
as well)I don't know what exactly you are looking for in a split button, but this video on how to create one is pretty complete and makes a splitbutton that is just about perfect.
http://windowsclient.net/learn/video.aspx?v=3929
I know you didn't want a tutorial, but I've used this before and you couldn't tell the difference between it and the ones in outlook.
Another good free implementation that seem to have it all:
http://huydinhpham.blogspot.com/2008/09/wpf-drop-down-and-split-button.html