所见即所得 html 编辑器查询

发布于 2024-08-16 18:20:28 字数 282 浏览 2 评论 0原文

我正在创建一个简单的所见即所得 HTML 编辑器,以使我的应用程序的用户能够设计简单的 HTML 电子邮件。

目前,我决定使用带有 MSHTML 的 Web 浏览器控件来编辑显示的内容。我有一个工具栏,其中包含所有相关按钮、粗体、下划线等。

我需要一种方法来检查当前块是否具有任何格式,以便可以在工具栏中的按钮上显示正确的状态。我尝试向 IHTMLDocument 添加一个事件处理程序,以便在移动鼠标或按下箭头键时触发,但是,这会阻止 Web 浏览器接受任何输入。

有没有更简单的方法来实现这个目标?

I am in the process of creating a simple WYSIWYG HTML editor to enable the users of my application to design simple HTML emails.

At the moment I have decided to use the web browser control with MSHTML to enable me to edit what is displayed. I have a tool bar which holds all of the relevant buttons, bold, underline, etc.

I need a way to check if the current block has any formatting so the correct state can be displayed on the buttons in the tool bar. I tried to add an event handler to the IHTMLDocument to fire when the mouse is moved or the arrow keys are pressed, however, this stopped the web browser from taking any input.

Is there a simpler way to achieve this goal?

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

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

发布评论

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

评论(1

兮子 2024-08-23 18:20:29

有几个免费的丰富编辑器,其中tinyMCE是最好的编辑器之一。

有关编辑列表,请参阅下面的链接。

http://www.queness .com/post/212/10-jquery-and-non-jquery-javascript-rich-text-editors

There are several rich editors for free out of that tinyMCE is one of the better editor.

For list of editors see the link below.

http://www.queness.com/post/212/10-jquery-and-non-jquery-javascript-rich-text-editors

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