private void SetHandler(InternetExplorer explorer) { try { // Register the oncontextmenu event of the document in InternetExplorer. HTMLDocumentEventHelper helper = new HTMLDocumentEventHelper(explorer.Document as HTMLDocument); helper.oncontextmenu += new HtmlEvent(oncontextmenuHandler); } catch { } }
void SetHandler(InternetExplorer explorer) { try { // 在IE浏览器中注册文档的 oncontextmenu 事件 HTMLDocumentEventHelper helper = new HTMLDocumentEventHelper(explorer.Document as HTMLDocument); helper.oncontextmenu += new HtmlEvent(oncontextmenuHandler); } catch { } }