网页浏览器禁用复制粘贴

发布于 2024-12-05 04:27:49 字数 96 浏览 7 评论 0原文

我有几个关于 WP7 中的 WebBrowser 控件的问题。

  1. 如何通过点击禁用单词选择?
  2. 如何通过手势禁用垂直滚动?

I have a several question about WebBrowser control into WP7.

  1. How to disable word selection by a click?
  2. How to disable vertical scrollable by a gesture?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

泪意 2024-12-12 04:27:49

向您的 html 页面添加一些额外的样式,并将其呈现在 WebBrowser 控件上

  1. body {-ms-user-select: none;} 使用此 css 代码通过点击禁用单词选择
    Windows Phone 7/8

    上的 IE

  2. 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

  1. body {-ms-user-select: none;} use this css code to disable word selection by tap
    in IE on Windows phone 7/8

  2. body {-ms-touch-action: none;} use this css code to disable vertical scroll

    in IE on windows phone 7/8

hope this work fine for you.

风渺 2024-12-12 04:27:49

首先,你可以使用视觉树助手获得一个边框控件,它是 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.

圈圈圆圆圈圈 2024-12-12 04:27:49

复制和过去的答案=“我不相信你可以阻止它发生,除非它是你的网页并且你可以将其设置为只读文档。”-如果我错了,请纠正我。-

答案通过手势垂直滚动 =“您可以构建手势来返回 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!"

若言繁花未落 2024-12-12 04:27:49

您可以使用 javascript 来实现禁用选择:

function DisableSelect() { var handler = function (e) {e.returnValue = false;} document.body.attachevent('onselectstart',handler,false);}

而不是从代码中调用:

wb.InvokeScript("DisableSelect");

不要忘记分离事件。

You can achieve disabling selection using javascript:

function DisableSelect() { var handler = function (e) {e.returnValue = false;} document.body.attachevent('onselectstart',handler,false);}

and than calling from your code:

wb.InvokeScript("DisableSelect");

Don't forget to detach the event.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文