Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Drop Down List with WPF Menu Controls

Tags:

c#

.net

wpf

I am looking for a way to add a drop down list in WPF to a menu. This used to be really easy in winforms and so I am expecting you experts to know just now to do it in WPF. Thanks.

Sorry if this is a bad question, it is late and I don't want to think.

like image 424
smaclell Avatar asked Oct 13 '08 06:10

smaclell


2 Answers

It is very easy to add any UIElement to any control, You can just add Combobox to a Menu control and create menu as bellow.

<Menu>
    <MenuItem Header="File">
        <MenuItem Header="Open"/>
        <MenuItem Header="Close"/>
        <Separator/>
        <ComboBox Width="85" Height="21.96" />
    </MenuItem>
</Menu>
like image 192
Jobi Joy Avatar answered Nov 11 '22 06:11

Jobi Joy


While this is very easy to do as Jobi Joy has shown, I think it has horrible usability. The Menu control supports multiple levels of menu items and I would go down that route for UI consistency.

like image 19
Alan Le Avatar answered Nov 11 '22 05:11

Alan Le