Skip to main content
 首页 » 编程设计

c#之wpf:更改 WebBrowser 控件的字体大小

2024年02月03日25jillzhang

如何做到这一点?

请您参考如下方法:

WPF 的正确方法:

using mshtml; //reference to COM object "Microsoft HTML Object Library"

...

var doc = web.Document as HTMLDocument;
if (doc != null)
{
doc.execCommand("SelectAll", false, null);
doc.execCommand("FontSize", false, 5);
doc.execCommand("Unselect", false, null);
}

附加信息 - http://msdn.microsoft.com/en-us/library/ms533049(VS.85).aspx