Пример #1
0
        // NewWindow3 event, used on Windows XP SP2 and higher
        private void axWebBrowser1_NewWindow3(object sender, AxSHDocVw.DWebBrowserEvents2_NewWindow3Event e)
        {
            Form1 frmWB;

            frmWB = new Form1();

            frmWB.axWebBrowser1.RegisterAsBrowser = true;
            e.ppDisp      = frmWB.axWebBrowser1.Application;
            frmWB.Visible = true;

            frmWB.TopMost = true;
        }
Пример #2
0
        /// <summary>
        /// 这是按下Shift点击时弹出新窗口的事件,应该打开一个新标签页
        /// </summary>
        private void AxWebBrowser1_NewWindow3(object sender, AxSHDocVw.DWebBrowserEvents2_NewWindow3Event e)
        {
            BrowserForm frmBrowser = new BrowserForm();

            frmBrowser.TitleChange = TitleChange;
            e.ppDisp = frmBrowser.AxWebBrowser1.Application;
            if (this.DockPanel != null)
            {
                frmBrowser.Show(this.DockPanel);
            }
            else
            {
                frmBrowser.Show();
            }
        }