webBrowser 编辑模式 修改字体大小 颜色 字体

qingshuijun 2016-11-24 09:37:08
Message "对 COM 组件的调用返回了错误 HRESULT E_FAIL。"
StackTrace " 在 System.Windows.Forms.UnsafeNativeMethods.IHTMLDocument2.GetDomain()\r\n 在 System.Windows.Forms.HtmlDocument.get_Domain()" string



object fnb = comboBox2.SelectedItem;
webBrowser2.Document.ExecCommand("SelectAll", true, null);
webBrowser2.Document.ExecCommand("FontSize", false, fnb);
webBrowser2.Document.ExecCommand("Unselect", true, null);



修改页面字体第一次成功后 再次修改就不会动了 最前面的是报错的代码






没有人知道如何解决么? 或者有其他更好的方法 JS 脚本试了 但是不执行
...全文
207 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
qingshuijun 2016-11-24
  • 打赏
  • 举报
回复
求助 刷新太快了 都沉底了
qingshuijun 2016-11-24
  • 打赏
  • 举报
回复

this.webBrowser2.Document.ExecCommand("SelectAll", true, null);
this.webBrowser2.Document.ExecCommand("FontSize", true, null);
this.webBrowser2.Document.ExecCommand("Unselect", true, null);
一样会报错
依伦哲罗 2016-11-24
  • 打赏
  • 举报
回复
同求 这服务器真是火爆 反复故障
qingshuijun 2016-11-24
  • 打赏
  • 举报
回复
等待ing…………

110,533

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧