OpenFileDialog上的块上下文菜单 [英] Block context menu on OpenFileDialog

查看:71
本文介绍了OpenFileDialog上的块上下文菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在显示.net框架随附的openfiledialog控件之后,是否可以以编程方式阻止用户访问列出文件的上下文菜单?

Is it possible to programatically block users for accesing the context menu on files listed after showing an openfiledialog control that comes with the .net framework?

目的是为了阻止他们访问打开或打开方式,仅允许他们从列表中选择文件。

The intent is to block them from accessing "open" or "open with" and only allow them to pick a file from the list.

我唯一的其他想法是构建自己的控件System.Windows.Forms.OpenFileDialog

My only other idea is to build my own control instead of using System.Windows.Forms.OpenFileDialog

推荐答案

在这种情况下,最快,最确定的选择是自行开发打开文件对话框。

your quickest and most surefire bet in that situation would be to roll out your own OpenFileDialog.

替代方法是尝试捕获打开文件对话框中的鼠标右键,而不允许对其进行处理

Alternatives would be to try and capture the right-mouse-click on the open file dialog and not allow it to be processed

作为一个旁注,我会被一个OpenFileDialog烦恼,它的行为不像那里的其他任何打开文件对话框(即不允许我执行重命名或打开方式的任务)

As a side note, I would be annoyed by a OpenFileDialog which does not behave like every other open file dialog out there (i.e. one that does not allow me to do tasks like renaming or "open with")

这篇关于OpenFileDialog上的块上下文菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆