private void viewUrlToolStripMenuItem_Click(object sender, EventArgs e) { if (!System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable()) MessageBox.Show("Warning: Please check your Internet connection!"); else { string url; if (authorResultsListView.Visible == true) url = Papers[authorResultsListView.FocusedItem.Index].TitleURL; else url = Papers[journalsResultsListView.FocusedItem.Index].TitleURL; if (url != null && !(url.ToLower().Equals("not found")) && url.Length > 0) { TabPage bpage = new TabPage("Browser"); Browser browser; browser = new Browser(url); bpage.Controls.Add(browser); bpage.ImageIndex = 1; Form1.dub_tab.TabPages.Insert(Form1.dub_tab.TabPages.Count - 1, bpage); Form1.dub_tab.SelectedTab = bpage; } else { MessageBox.Show("Sorry!Url unavailable"); } } }
private void openBrowserForUrl(string url) { if (url != null && !(url.ToLower().Equals("not found")) && url.Length > 0) { TabPage bpage = new TabPage("Browser"); Browser browser; browser = new Browser(url); bpage.Controls.Add(browser); bpage.ImageIndex = 1; Form1.dub_tab.TabPages.Insert(Form1.dub_tab.TabPages.Count - 1, bpage); Form1.dub_tab.SelectedTab = bpage; } else { MessageBox.Show("Sorry!Url unavailable"); } }