Here is my idea for solving this problem. The ToolStripButton control doesn't have a ContextMenu so if you want to add a context menu, you need to do some tricks. the MouseUp event is used // for showing the context menu of this buttonī.MouseUp += new MouseEventHandler(b_MouseUp) New ToolStripButton(el.InnerText, getFavicon(url),ī.ToolTipText = el.GetAttribute( " url") create a new ToolStripButton object with the favicon image, // website name the click eventhandler to // navigate to the specific web site if the links bar is visible then // you have to add a ToolStripButton if (linkBar.Visible = true) XmlElement root = myXml.CreateElement( " links") XmlElement el = myXml.CreateElement( " link")
#Open favorites in new tab how to#
The example below shows how to get the current tab:Ĭopy Code private void addLink( String url, string name) New EventHandler(browser_CanGoForwardChanged) New EventHandler(browser_CanGoBackChanged) New WebBrowserNavigatingEventHandler(Form1_Navigating) WebBrowserDocumentCompletedEventHandler(Form1_DocumentCompleted) WebBrowserProgressChangedEventHandler(Form1_ProgressChanged) add some event handlers to your browser object add the browser object to the tab page // you created previously add the newly created TabPage // to the tabcontrol's collection of tab pages The addNewTab() method shows how to add a new tab in your web browser. When the user clicks the "New" tab, then a new tab is created. In my main form, I added a TabControl control named browserTabControl with only one TabPage which represents the "New" tab. C# has a WebBrowser control that does all the work of rendering web pages. This article describes how to implement some of the features of a Web Browser application like managing tabs, viewing the favicon of a particular website, managing Favorites websites and Links Bar, viewing the History, searching on Google or Live Search, saving settings between application runs, viewing the source and properties of a website, printing the content of page, and others.