禁止在Webbrowser控件中编辑某些文本 [英] Prevent Editing Some Text in Webbrowser control

查看:98
本文介绍了禁止在Webbrowser控件中编辑某些文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿,
我正在Windows窗体应用程序中工作,该应用程序在用户控件编辑器控件中具有Web浏览器,该控件包含电子邮件内容,使用户能够更改电子邮件内容

但我需要修正一些文字(我希望用户无法对其进行更改)

有没有办法做到这一点,如果可以,我该怎么做?

hey,
I''m working in a windows form application which have a web browser in a user control editor control which containing an email content to give the user the ability to change the email content

but i need to make some text to be fixed (i want the user not to be able to change it)

is there any way to do this, and if yes, how can i do it please??

推荐答案

如果与您用于浏览的内容无关, WebBrowser控件或其他任何内容.
不可编辑的文本只是不是控件的HTML元素的内容,例如<p><div><span>等.

—SA
If has nothing to do with what you use for browsing, a WebBrowser control or anything else.
Non-editable text is just the content of an HTML element which is not a control, such as <p>, <div>, <span> and the like.

—SA


WebBrowser控件是在Windows窗体应用程序中打开html页面的控件,在我的应用程序中,查看的文本是可编辑的,我在询问如何防止用户从仅编辑查看文本的一行开始,然后我解决了这一问题,我将该行放入class ="fixed''的div中,并在按键事件中检查了选定文本的父级(如果是)具有class = fixed的div->我禁止编辑,否则,编辑工作会希望对任何有相同要求的人都有帮助
WebBrowser control is a control to open html page in windows form application and in my application the viewed text was editable i was asking for how to prevent user from editing only one line of the viewd text, and i solved it i put this line inside a div with class=''fixed'' and at the keypress event, i check on the parent of the selected text, if it''s a div with class=fixed --> i prevent the editing, else, the editing works i hope it help any one has the same requirements


这篇关于禁止在Webbrowser控件中编辑某些文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆