Textfield()-如何阻止鼠标右键菜单
Textfield () - 如何防止出现鼠标右键菜单(具有复制、粘贴、全选等选项的菜单)。
Textfield () - how to prevent mouse right click menu from appearing (a menu having COPY, PASTE, SELECT ALL etc options).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
FlashPlayers 默认菜单项。
据我所知,您无法删除有意义的基本 FlashPlayer 项目(设置和关于)。
FlashPlayers 内置项目
您可以通过在编译时或在代码中指定它来删除最重要的项目(播放、暂停等):
或在全局上下文中:
与 TextField 相关的菜单项< /strong>
文本字段的复制/粘贴/选择也是内置的,似乎您无法隐藏它们。 然而,您似乎确实想摆脱它们,这里有一个解决方法。
下面的示例说明了如何在文本字段上添加透明按钮以转移鼠标行为:
FlashPlayers default menu items.
As far as I know you cannot remove the basic FlashPlayer items (Settings and About) which make sense.
FlashPlayers inbuilt items
You can remove the top ones (Play, Pause, etc.) by either specifying it while compiling or from within the code:
or within the global context :
TextField related menu items
The copy/paste/select being inbuilt as well for TextFields it doesn't seem you can hide them. However as it seems like you really want to get rid of them here's a workaround.
The example below illustrates how you can add a transparent button over the textField to sidetrack the mouse behavior:
您是否尝试过使用自定义 InteractiveObject.contextMenu?
have you tried with a custom InteractiveObject.contextMenu?
将字段
selectable
属性设置为 false。Set the fields
selectable
property to false.我找到了隐藏 TextFields 的默认上下文菜单项的方法!
只需设置一个自定义上下文菜单,并隐藏内置项目。 现在,当您右键单击时,什么也没有发生!
I found a way to hide the default context menu items for TextFields!
Just set a custom context menu, and hide the inbuilt items. Now when you right click, nothing happens!