//create a new tab which loads the homepage if url == null private void initNewTab(string url) { TabPage tab = new TabPage(); Web page = new Web(this); //subscribes to Event in Web Class - allows for the method(s) the Web class calls - on Event - from this class to change //without having to recompile the Web class page.FaveEvent += OnFaveEvent; page.LoadHTML += OnLoadHTMLEvent; //adds the page to the tab tab.Controls.Add(page); //adds the tab to the browser tabControl.Controls.Add(tab); //if no url provided then load homepage if (url == null) { url = Homepage.getHomepageURL(); } tab.Text = url; page.loadHTML(url); }
private void goHomeBtn_Click(object sender, EventArgs e) { loadHTML(Homepage.getHomepageURL()); }