2011-01-07 97 views
3

我在DockPanel中有一個簡單的菜單。這裏是XAML:WPF菜單顯示在窗口的左側

<Window x:Class="WpfApplication1.MainWindow" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    Title="MainWindow" Height="350" Width="525"> 
<DockPanel> 
    <Menu DockPanel.Dock="Top"> 
     <MenuItem Name="file" Header="_File"> 
      <MenuItem Name="exitMenuItem" Header="E_xit"/> 
     </MenuItem> 
    </Menu> 
    <Grid> 
    </Grid> 
</DockPanel> 

爲什麼菜單下降到左側,而不是像大多數應用程序窗口邊框的右邊?

screenshot of Window

+0

您的代碼不顯示菜單項,以左側爲你在screnshot;這是在XP – 2011-01-07 22:53:28

+0

有趣。我會在我的Win XP虛擬機中嘗試它。我正在使用Win 7 x64。 – Nate 2011-01-07 23:14:23

回答