【问题标题】:how to disable contextmenu of devexpress themedwindow in wpf c#如何在wpf c#中禁用devexpress主题窗口的上下文菜单
【发布时间】:2021-04-14 14:16:50
【问题描述】:

当我使用鼠标右键单击标题栏时,我正在尝试禁用 devexpress 的 ThemedWindow 弹出的上下文菜单。

我使用了下面的代码,它在“Window”中工作,但“ThemedWindow”不起作用:

public MainWindow()
{
    InitializeComponent();
    Loaded += MainWindow_Loaded;
}

private void MainWindow_Loaded(object sender, RoutedEventArgs e)
{
    IntPtr windowHandle = new WindowInteropHelper(this).Handle;
    HwndSource hwndSource = HwndSource.FromHwnd(windowHandle);
    hwndSource.AddHook(new HwndSourceHook(WndProc));
}

private IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
{
    if (msg == 0xa4)
    {
        handled = true;
    }
    return IntPtr.Zero;
}

如果我想在 ThemedWindow 中做同样的事情,我应该怎么做?

【问题讨论】:

    标签: c# wpf window devexpress


    【解决方案1】:
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-03-18
    • 1970-01-01
    • 1970-01-01
    • 2014-01-19
    • 2013-08-05
    • 1970-01-01
    相关资源
    最近更新 更多