Ejemplo n.º 1
0
        /// <summary>
        /// Creates a new tab which will open to a specified url and adds it to the browser.
        /// </summary>
        /// <param name="url">The url that the new tab should open to</param>
        public void AddTab(string url)
        {
            TabPage        newtab     = new TabPage();
            TabUserControl newControl = new TabUserControl(newtab, this.logBox, this, url);

            NewTab(newControl, newtab);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates a new tab and adds it to the browser. Tab opens on home page
        /// </summary>
        private void AddTab()
        {
            TabPage        newtab     = new TabPage();
            TabUserControl newControl = new TabUserControl(newtab, this.logBox, this);

            NewTab(newControl, newtab);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Places a user control onto a tab page then adds that tab to the window.
        /// Controls setup of the control on the tab page. When finished will activate the new tab.
        /// </summary>
        /// <param name="newTabControl">The user control to be placed on the tab</param>
        /// <param name="newTab">The new tab to be added to the browser</param>
        private void NewTab(TabUserControl newTabControl, TabPage newTab)
        {
            Contract.Requires(newTab != null);
            Contract.Requires(newTabControl != null);

            webTabs.TabPages.Add(newTab);
            newTab.Controls.Add(newTabControl);
            newTabControl.Anchor = (AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Bottom); //Ensures the control will resize with the window
            webTabs.SelectedTab  = newTab;
        }
 public VerticalTabHost()
 {
     InitializeComponent();
     TabControl = new TabUserControl();
 }