Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 6th, 2012  |  syntax: None  |  size: 1.06 KB  |  hits: 10  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. WPF menus are not positioned normally
  2. <Window x:Class="TestDrive.MainWindow"
  3.         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4.         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5.         Title="MainWindow" Height="350" Width="525">
  6.     <Grid>
  7.         <Menu Height="23" HorizontalAlignment="Left" Name="menu1" VerticalAlignment="Top" Width="200">
  8.             <MenuItem Header="File">
  9.                 <MenuItem Command="ApplicationCommands.Close" Header="Exit" />
  10.             </MenuItem>
  11.             <MenuItem Header="Edit" />
  12.         </Menu>
  13.     </Grid>
  14. </Window>
  15.        
  16. <Window x:Class="TestDrive.MainWindow"
  17.         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  18.         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  19.         Title="MainWindow">
  20.     <DockPanel>
  21.         <Menu DockPanel.Dock="Top">
  22.             <MenuItem Header="File">
  23.                 <MenuItem Command="ApplicationCommands.Close" Header="Exit" />
  24.             </MenuItem>
  25.             <MenuItem Header="Edit" />
  26.         </Menu>
  27.     </DockPanel>
  28. </Window>