TWebBrowser本身有Undo功能,
当它内容被修改,
我们可以按Ctrl-Z或执行Doc.ExecCommand('Undo', False, EmptyParam);回复修改前的内容。基于某些原因,我希望有内容被修改后,能够清空Undo内容,
即Doc.QueryCommandEnabled('Undo')使其返回False请问,怎么清空Undo的内容,使其不能Undo?

解决方案 »

  1.   

    自己在control site里加一个IOleCommandTarget的实现,在实现里给QueryCommandEnabled('Undo')使其返回False看看。
    实现参考http://stackoverflow.com/questions/5450514/webbrowser-msie-capture-js-errors-using-exec-of-iolecommandtarget
      

  2.   

    不懂。在实现里给QueryCommandEnabled('Undo')使其返回False?我不是永远都不要有Undo,而是希望必要时能够 Reset。要怎么做,你能够说得清楚一点吗?