![](/img/trans.png)
[英]How to get the content of a DevExpress GridControl in XAML from C# in WPF
[英]how to disable contextmenu of devexpress themedwindow in wpf c#
當我使用鼠標右鍵單擊標題欄時,我正在嘗試禁用 devexpress 主題窗口的彈出上下文菜單。
我使用了下面的代碼,它在“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 中做同樣的事情,我應該怎么做?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.