WPF 菜单显示在窗口左侧
我在 DockPanel 中有一个简单的菜单。这是 XAML:
<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>
为什么菜单会像大多数应用程序一样下拉到窗口边框的左侧而不是右侧?
I have a simple Menu in a DockPanel. Here is the XAML:
<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>
Why does the Menu drop down to the left instead of the right of the window border like most applications?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您似乎有平板电脑输入设备。按照此链接中的说明更改 Tablet PC 设置中的惯用手:
It appears that you have a tablet input device. Follow the instructions in this link to change the handedness in your Tablet PC Settings:
对我有用的修复是:
信用:
https://www.telerik.com/论坛/弹出窗口在 splitbutton 中打开到外部窗口
A fix that worked for me was:
Credit:
https://www.telerik.com/forums/popup-is-opening-to-outside-window-in-splitbutton