Create a menu Bar in WPF?

deception1 picture deception1 · Mar 30, 2012 · Viewed 166k times · Source

I want to create a menu bar identical to the one in windows forms in my WPF application.

How would I do this?

The menu option in the WPF controls toolbox only gives a blank bar.

Answer

ionden picture ionden · Mar 30, 2012
<DockPanel>
    <Menu DockPanel.Dock="Top">
        <MenuItem Header="_File">
            <MenuItem Header="_Open"/>
            <MenuItem Header="_Close"/>
            <MenuItem Header="_Save"/>
        </MenuItem>
    </Menu>
    <StackPanel></StackPanel>
</DockPanel>