System.Windows.Forms.FolderBrowserDialog dlg = new FolderBrowserDialog();
HwndSource source = PresentationSource.FromVisual(this) as HwndSource;
System.Windows.Forms.IWin32Window win = new OldWindow(source.Handle);
System.Windows.Forms.DialogResult result = dlg.ShowDialog(win);
我使用这个功能来获取文件夹对话框,但现在我需要禁用该文件夹对话框中的右键单击,以防止从那里删除文件夹。创建自定义文件夹对话框是我不想采取的最后一种选择。
因此,有人能否建议任何可能的解决方案,而不需要自定义文件夹对话框。