Inheritance: System.Windows.Forms.TabPage
Ejemplo n.º 1
0
        /* {@@} */
        private void currentPage_WindowClosing(object sender, EventArgs e)
        {
            WebBrowserTabPage tab = (WebBrowserTabPage)sender;

            if (tab == currentPage)
            {
                closeTabToolStripMenuItem_Click(sender, e);
            }
        }
Ejemplo n.º 2
0
        public MainForm()
        {
            InitializeComponent();

            // an an initial tab
            WebBrowserTabPage page = new WebBrowserTabPage();

            tabControl.TabPages.Add(page);
            currentPage = page;

            RegisterBrowserEvents();

            // tabcontrol events
            tabControl.SelectedIndexChanged += (s, e) =>
            {
                if (currentPage != null)
                {
                    UnregisterBrowserEvents();
                }
                currentPage = (WebBrowserTabPage)tabControl.SelectedTab;
                if (currentPage != null)
                {
                    RegisterBrowserEvents();
                    if (currentPage.browser.Url != null)
                    {
                        navigationBar.UrlText = currentPage.browser.Url.ToString();
                    }
                    else
                    {
                        navigationBar.UrlText = "";
                    }

                    this.Text = "WebKit Browser Example - " + currentPage.browser.DocumentTitle;

                    currentPage.browser.Focus();
                }
            };

            // navigation bar events
            navigationBar.Back    += () => { currentPage.browser.GoBack(); ActivateBrowser(); };
            navigationBar.Forward += () => { currentPage.browser.GoForward(); ActivateBrowser(); };
            navigationBar.Go      += () => { currentPage.browser.Navigate(navigationBar.UrlText); ActivateBrowser(); };
            navigationBar.Refresh += () => { currentPage.browser.Reload(); ActivateBrowser(); };
            navigationBar.Stop    += () => { currentPage.Stop(); ActivateBrowser(); };
        }
Ejemplo n.º 3
0
        public MainForm()
        {
            InitializeComponent();

            // an an initial tab
            WebBrowserTabPage page = new WebBrowserTabPage();
            tabControl.TabPages.Add(page);
            currentPage = page;

            RegisterBrowserEvents();

            // tabcontrol events
            tabControl.SelectedIndexChanged += (s, e) =>
            {
                if (currentPage != null)
                    UnregisterBrowserEvents();
                currentPage = (WebBrowserTabPage)tabControl.SelectedTab;
                if (currentPage != null)
                {
                    RegisterBrowserEvents();
                    if (currentPage.browser.Url != null)
                        navigationBar.UrlText = currentPage.browser.Url.ToString();
                    else
                        navigationBar.UrlText = "";

                    this.Text = "WebKit Browser Example - " + currentPage.browser.DocumentTitle;

                    currentPage.browser.Focus();
                }
            };

            // navigation bar events
            navigationBar.Back += () => { currentPage.browser.GoBack(); ActivateBrowser(); };
            navigationBar.Forward += () => { currentPage.browser.GoForward(); ActivateBrowser(); };
            navigationBar.Go += () => { currentPage.browser.Navigate(navigationBar.UrlText); ActivateBrowser(); };
            navigationBar.Refresh += () => { currentPage.browser.Reload(); ActivateBrowser(); };
            navigationBar.Stop += () => { currentPage.Stop(); ActivateBrowser(); };
        }
Ejemplo n.º 4
0
 private void newTabToolStripMenuItem_Click(object sender, EventArgs e)
 {
     WebBrowserTabPage page = new WebBrowserTabPage();
     tabControl.TabPages.Add(page);
 }
Ejemplo n.º 5
0
        private void newTabToolStripMenuItem_Click(object sender, EventArgs e)
        {
            WebBrowserTabPage page = new WebBrowserTabPage();

            tabControl.TabPages.Add(page);
        }