views:

186

answers:

3

I'm trying to create some drop-downs for a toolbar and want them to look like the Page Layout drop-downs in Word (such as the Orientation and Size menus).

I've attempted to do this using a ComboBox, but I can't figure out how to show the option name, rather than the selected item at the top of the ComboBox. Is it possible to make the ComboBox show whatever you want it to at the top?

Should I be trying to do this with a ComboBox or is there a better way to go about this?

alt text

EDIT: It looks like I need a Ribbon control. Can I make a simple one out of a ComboBox? It seems like I'm close, I just need to be able to display a category in the ComboBox instead of the selected item.

+4  A: 

Word uses the Ribbons.

Here is the WPF Ribbons project. This will have a way to do what you are looking for.

David Basarab
For security reasons I'm unable to download the MS control the article refers to, so for now I'm going to have to try a different way. Any ideas?
smoore
+1 Thanks for giving me the right terminology. Googleing is a lot easier when you use the right words.
smoore
+2  A: 

You can build this using a combo box if you want, take a look at the ComboBox ControlTemplate example at: http://msdn.microsoft.com/en-us/library/ms752094.aspx

You can see in that page that the combobox is composed of a toggle button, a popup, a text box and a content presenter (only one of the last two is visible, depending on the combobox mode).

You can remove the text box and the content presenter from the combobox template and replace them with whatever you want - for example, a big icon and the option name.

You can also use the same technique of toggle button bound to a popup to create your own (non-combobox) drop down control.

Nir
Thanks for the idea. I had no knowledge of the Popup control. I went with a Button and Popup and it worked great. Thanks!
smoore
+2  A: 

I haven't tried it myself, but the WPF "Fluent Ribbon Control Suite" was added to the Visual Studio Gallery earlier this week.

Brian Schroer