如何在webbrowser控件上禁用文本选择和图片拖动? [英] how can i disable the text selection and picture drag on a webbrowser control?
问题描述
我已被谷歌搜索了几个小时但找不到解决方案
我正在做一个触摸屏界面,浏览一个页面,我使用了一个webbrowser控件,并为了骑车丑陋的滚动条,我试图在webbrowser上使用mousedown和mousemove事件移动页面,它工作但是当我这样做时,它也选择并突出显示网络上的内容,我该如何阻止它?
我是否需要通过继承原始的一个来创建扩展的web浏览器控件?如果是,我应该捕获哪个事件并覆盖处理程序?
如何添加更多在这个例子中的事件和事件处理程序,以实现这一点?
http://social.msdn.microsoft.com/forums/en-US/winforms/thread/eab43afa-df4d-4278-926a-b07d2d6ca9fd/
或
有没有简单的方法?
I have been googled for couple of hours but couldn't find a solution
I m doing a touch screen interface, to browser a page I used a webbrowser control, and in order to get ride of the ugly scrollbar, i m trying to use mousedown and mousemove event on the webbrowser to move the page around, it worked but when i m doing it, it select and highlight the content on the web too, how can i stop that?
do I need to create a extended webbrowser control by Inherits the orginal one?
if so, which event should i capture and override the handler?
how can i add more event and event handler on this example to achive that?
http://social.msdn.microsoft.com/forums/en-US/winforms/thread/eab43afa-df4d-4278-926a-b07d2d6ca9fd/
or
is there any simple way?
推荐答案
HI,
要禁用选择文字,请使用
To disable selecting text use
onselectionstart ='return false'
onselectionstart='return false'
ondragstart ='返回false'页面正文标记属性
ondragstart='return false' inside page body tag attribute
这篇关于如何在webbrowser控件上禁用文本选择和图片拖动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!