问题
How to do this?
回答1:
public IHTMLDocument2 Document
{
get
{
return webBrowser.Document as IHTMLDocument2;
}
}
...
Document.execCommand("FontSize", false, doubleValue.ToString())
This shold help
回答2:
Right way for 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);
}
additional information - http://msdn.microsoft.com/en-us/library/ms533049(VS.85).aspx
来源:https://stackoverflow.com/questions/1119055/wpf-change-font-size-for-webbrowser-control