如何更改使用字体对话框在Web浏览器控件中输入的所选文本颜色……? [英] how to change the selected text color which i was entered in web browser control using font dialog box......?

查看:97
本文介绍了如何更改使用字体对话框在Web浏览器控件中输入的所选文本颜色……?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

private void Font_Click(object sender, EventArgs e)
       {
           DialogResult r = fontDialog1.ShowDialog();
           if (r == DialogResult.OK)
           {
               Font font = fontDialog1.Font;
               //this.webBrowser1.DocumentText = string.Format("Font is: {0}", font.Name);
               this.webBrowser1.DocumentText = font;
           }
       }





我在网络浏览器控件中输入了一些文字...
我需要使用字体对话框控件更改选定的文本颜色,字体样式,字体大小.





i entered some text in web browser control...
i need to change the selected text color,font style, font size using font dialog box control

推荐答案

如果要修改HTML元素和文本文档,请看以下内容:

IHTMLDocument2接口

要使用它,您需要引用" C:\ Program Files \ Microsoft.NET \ Primary Interop Assemblies \ Microsoft.mshtml.dll "
If you want to modify the HTML elements and text in the document, look at this:

IHTMLDocument2 interface

To use it you need a reference to "C:\Program Files\Microsoft.NET\Primary Interop Assemblies\Microsoft.mshtml.dll"


这篇关于如何更改使用字体对话框在Web浏览器控件中输入的所选文本颜色……?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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