- 自定义窗口边框
鼠标右键点击便不会弹出
2.将ContextMenu菜单和右键点击方法重写
MouseRightButtonDown="Window_MouseRightButtonDown"
IsWindowDraggable="False">
<Window.ContextMenu>
<ContextMenu x:Name="EmptyContextMenu">
</ContextMenu>
</Window.ContextMenu>
private void Window_MouseRightButtonDown(object sender, MouseButtonEventArgs e) {
if (this.EmptyContextMenu != null) {
this.EmptyContextMenu.IsOpen = true;
}
// 阻止系统右键菜单
e.Handled = true;
}