0
我正在使用WebBrowser控件作爲Windows窗體應用程序中的文本編輯器。由於某些原因,我需要在某些操作後清除瀏覽器的撤銷堆棧。爲了達到這個目的,我使用Windows Vista上的ExecCommand(「ms-clearUndoStack」)
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)
有沒有辦法避免這種異常或可能以另一種方式來清除撤消堆棧?
感謝信息。 – tafkab76