【问题标题】:ExecCommand("ms-clearUndoStack") on Windows VistaWindows Vista 上的 ExecCommand("ms-clearUndoStack")
【发布时间】:2015-12-03 12:54:00
【问题描述】:

我在 Windows 窗体应用程序中使用 WebBrowser 控件作为文本编辑器。由于某些原因,我需要在某些操作后清除浏览器的撤消堆栈。为此,我使用

webBrowser1.Document.ExecCommand("ms-clearUndoStack", false, null);

它适用于除 Windows Vista 之外的所有操作系统。在 Vista 上,我得到以下 ArgumentException:

   System.ArgumentException: Value does not fall within the expected range.
       at System.Windows.Forms.UnsafeNativeMethods.IHTMLDocument2.ExecCommand(String cmdID, Boolean showUI, Object value)

有没有办法避免异常,或者是否有其他方法可以清除撤消堆栈?

【问题讨论】:

    标签: winforms webbrowser-control windows-vista


    【解决方案1】:

    此命令在 Windows Vista 上不可用,因为它由 msdn "Commands A-C (JavaScript)" 文章发布

    ms-clearUndoStack
    Clears the undo history.
    Minimum availability is IE11
    

    IE11 minimum 操作系统要求是 Windows 7 SP1

    【讨论】:

      猜你喜欢
      • 2011-05-28
      • 2014-03-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-12-21
      • 1970-01-01
      • 2012-02-20
      相关资源
      最近更新 更多