WPF SplitButton? [closed]

2019-01-31 23:17发布

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 SplitButtons 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 SplitButtons 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.

8条回答
叼着烟拽天下
2楼-- · 2019-01-31 23:50

There is a pretty good split button implementation for WPF and Silverlight over Delay's blog:

Banana SplitButton (A WPF-specific fix for SplitButton and some code analysis improvements for the Silverlight version, too)

查看更多
Explosion°爆炸
3楼-- · 2019-01-31 23:55

I think what you mean is called a DropDownButton. There is a boolean property on MenuItem "StaysOpenOnClick" which could solve your problem.

查看更多
登录 后发表回答