网页浏览器禁用复制粘贴
我有几个关于 WP7 中的 WebBrowser 控件的问题。
- 如何通过点击禁用单词选择?
- 如何通过手势禁用垂直滚动?
I have a several question about WebBrowser control into WP7.
- How to disable word selection by a click?
- How to disable vertical scrollable by a gesture?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
向您的 html 页面添加一些额外的样式,并将其呈现在 WebBrowser 控件上
body {-ms-user-select: none;}
使用此 css 代码通过点击禁用单词选择在 Windows Phone 7/8
上的 IE 中
body {-ms-touch-action: none;}
使用此 css 代码禁用垂直滚动在 Windows Phone 7/8 上的 IE 中
垂直滚动希望这对您有用。
Add some extra styles to your html pages and render it on WebBrowser control
body {-ms-user-select: none;}
use this css code to disable word selection by tapin IE on Windows phone 7/8
body {-ms-touch-action: none;}
use this css code to disable vertical scrollin IE on windows phone 7/8
hope this work fine for you.
首先,你可以使用视觉树助手获得一个边框控件,它是 ie9 移动核心的容器
然后
Q1:你可以取消边框控件中发生的“点击”手势,然后再将其传递给 ie 核心
Q2:你可以取消“ DragDelta”手势用于某个方向或距离,即。垂直滚动。
first , u can get a border control which is the container of the ie9 mobile core using visual tree helper
then
Q1: u can cancel the "Tap" gesture occurred in border control before it was passed to ie core
Q2: u can cancel the "DragDelta" gesture for some direction or distance ,well ie. vertical scroll.
复制和过去的答案=“我不相信你可以阻止它发生,除非它是你的网页并且你可以将其设置为只读文档。”-如果我错了,请纠正我。-
答案通过手势垂直滚动 =“您可以构建手势来返回 Null 而不是事件值,几乎告诉它如果发生这种情况则取消它......不返回任何内容!”
The answer to Copy and Past = "I don't believe you can stop it from occurring, unless its your webpage and you can set it up for a Read Only Document."-If i am wrong please correct me.-
the answer to Vertical Scrollable By a Gesture = "You could build the Gesture to Return a Null instead of the event value, Pretty much tell it that if this occurs then Cancel it....Return Nothing!"
您可以使用 javascript 来实现禁用选择:
而不是从代码中调用:
不要忘记分离事件。
You can achieve disabling selection using javascript:
and than calling from your code:
Don't forget to detach the event.