private void cEXWB1_WBContextMenu(object sender, csExWB.ContextMenuEventArgs e) { try { IHTMLElement pelem = cEXWB1.GetActiveElement(); frmPropertyExplorer frm = new frmPropertyExplorer(); frm.SetWindowProperties(MainScript, PopupName, pelem); frm.Location = e.pt; frm.ShowInTaskbar = false; frm.ShowDialog(); e.displaydefault = false; } catch (Exception ex) { AllForms.m_frmLog.AppendToLog("WBContext Failure\r\n" + ex.ToString()); } }
void MakerView_WBContextMenu(object sender, csExWB.ContextMenuEventArgs e) { //非录制状态不显示上下文菜单 if (!AppContext.Current.State.IsRecord) { return; } MyBrowser browser = AppContext.Current.Browser as MyBrowser; browser.Selector.Restore(); browser.Selector.Highlight((mshtml.IHTMLElement)e.ctxmenuelem); e.displaydefault = false; if (contextMenuStrip.Items.Count == 0) { contextMenuStrip.Items.AddRange(GetItems()); } e.pt.Offset(15, 5); contextMenuStrip.Show(e.pt); }