1

When designing a WinForms app in visual studio, you can choose to populate a menu bar with the standard set of File, Save, Help, About, etc. Is there a way to do this in WPF using visual studio?

H.B.
  • 142,212
  • 27
  • 297
  • 366
user754852
  • 463
  • 1
  • 4
  • 9

1 Answers1

0

No you must add the menu items youself in wpf, but it is very easy to do, here is an example:

<Menu IsMainMenu="True">
  <MenuItem Header="_File" />
  <MenuItem Header="_Edit">
    <MenuItem Header="_Cut"/>
    <MenuItem Header="_Copy"/>
    <MenuItem Header="_Paste"/>
  </MenuItem>
  <MenuItem Header="_View" />
  <MenuItem Header="_Window" />
  <MenuItem Header="_Help" />
</Menu>

for more detail see - http://www.wpftutorial.net/Menus.html

Eamonn McEvoy
  • 8,708
  • 13
  • 52
  • 80
  • The link doesn't mention how to hook up commands and keyboard shortcuts. –  Apr 13 '13 at 21:19
  • however: http://stackoverflow.com/questions/10209231/bind-a-keyboard-shortcut-to-a-command-in-the-view-model-in-wpf – Eamonn McEvoy Apr 14 '13 at 13:30
  • @EamonnMcEvoy in WinForms the command :Insert Standart Menu Item..." populate items with the key-shorcut and the icons. – dovid May 25 '15 at 19:36