如何禁用右键单击选项
问题描述:
如何使用C#以编程方式禁用Windows中的右键单击选项。
提前致谢....!
how to disable right-click's option in windows using C# programmatically.
Thanks in advance....!
答
在文本框级别,只需将文本框属性ShortcutsEnabled设置为false即可获得它。
处理右键单击表单并禁用右键单击例如
At textbox level, simply set the textbox property "ShortcutsEnabled" to false and you got it.
Handle the right click on form and disable right click for e.g.
private void form_MouseClick(object sender, MouseEventArgs e)
{
if (e.Button == System.Windows.Forms.MouseButtons.Right)
{
//more logic here
}
}
你可以做到使用java脚本
you can do it by using java script
</head>
<body oncontextmenu="return false" onselectstart="return false" ondragstart="return false">
....
</body>
或者您也可以在表格中使用
or you can use it also in table prperty