public void NewWindow3(object pDisp, ref bool cancel, ref object flags, ref string urlContext, ref string url)
            {
                NewWindowExtendedEventArgs e = new NewWindowExtendedEventArgs(new Uri(url));

                browser.OnNewWindowExtended(e);
                cancel = e.Cancel;
            }
 protected virtual void OnNewWindowExtended(NewWindowExtendedEventArgs e)
 {
     if (NewWindowExtended != null)
     {
         NewWindowExtended(this, e);
     }
 }
Пример #3
0
        void webBrowser_NewWindowExtended(object sender, NewWindowExtendedEventArgs e)
        {
            e.Cancel = true;
            //显示在软件主界面的主选项卡文档中
            //WorkbenchSingleton.Workbench.Instance.ShowView(new BrowserPane(e.Url));

            //显示在软件主界面的主选项卡文档中
            BrowserPane browserPane = new BrowserPane();

            browserPane.View.Dock = DockStyle.Fill;

            //FormBrowser dockContent = new FormBrowser();
            //dockContent.HideOnClose = false;
            //dockContent.TabText = "Browser";
            //dockContent.Controls.Add(browserPane.Control);

            //Workbench.Instance.ShowView(dockContent);

            if (NewWindow != null)
            {
                NewWindow(this, new HtmlViewPaneNewWindowEventArgs(browserPane, e.Url));
            }
        }