private void button2_Click(object sender, EventArgs e) { Browser2 browser2 = new Browser2(); { browser2.Show(); this.Hide(); } }
private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e) { Browser2 browser2 = new Browser2(); browser2.tabControl.SelectedTab.Text = browser2.webBrowser3.DocumentTitle; }
private void btnSearch_Click(object sender, EventArgs e) { // const string apiKey = "AIzaSyAt8AkrmkiLVghrcKA3lFh37R79rSG0NsE"; // const string cx = "003470263288780838160:ty47piyybua"; string query = richTextBoxSearch.Text; Browser2 browser2 = new Browser2(); WebBrowser web = browser2.tabControl.SelectedTab.Controls[0] as WebBrowser; textBoxUrl.Text = richTextBoxSearch.Text; String comboBoxItem = null; comboBoxItem = comboxSearchPlatform.SelectedItem.ToString(); string urlGoogle = "https://www.google.com/search?q=" + richTextBoxSearch.Text; string urlBing = "https://www.bing.com/search?q=" + richTextBoxSearch.Text; string urlduckDuckGo = "https://duckduckgo.com/?q=" + richTextBoxSearch.Text; string urlyouTube = "https://www.youtube.com/search?q=" + richTextBoxSearch.Text; string urlWikipedia = "https://en.wikipedia.org/wiki/" + richTextBoxSearch.Text; // string urlAll = "file:///J:/Chrome%20Extension%20App/ChromeExtensionApplication/Browser/GoogleCustomSearch.html"; if (comboxSearchPlatform.Text.Equals("SEARCH PLATFORM") && comboxSearchPlatform.SelectedIndex.Equals(0) && comboxSearchPlatform.SelectedItem.Equals(null)) { MessageBox.Show("Please select something from search platform and continue AGAIN!!", "Alert", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); this.Show(); } //if (richTextBoxSearch.Text != null && comboBoxItem.Equals("SEARCH PLATFORM")) //{ // //browser2.webBrowser3.Navigate(urlAll); // //browser2.textBoxUrl.Text = urlAll; // //this.Hide(); //} else if (richTextBoxSearch.Text != null && comboBoxItem.Equals("ALL")) { browser2.Show(); // browser2.webBrowser3.Navigate(urlAll); // browser2.textBoxUrl.Text = urlAll; this.Hide(); } else if (richTextBoxSearch.Text != null && comboBoxItem.Equals("GOOGLE")) { browser2.Show(); browser2.webBrowser3.Navigate(urlGoogle); browser2.textBoxUrl.Text = urlGoogle; this.Hide(); } else if ((richTextBoxSearch.Text != null && comboBoxItem.Equals("BING"))) { browser2.Show(); browser2.webBrowser3.Navigate(urlBing); browser2.textBoxUrl.Text = urlBing; this.Hide(); } else if ((richTextBoxSearch.Text != null && comboBoxItem.Equals("DUCKDUCKGO"))) { browser2.Show(); browser2.webBrowser3.Navigate(urlduckDuckGo); browser2.textBoxUrl.Text = urlduckDuckGo; this.Hide(); } else if ((richTextBoxSearch.Text != null && comboBoxItem.Equals("YOUTUBE"))) { browser2.Show(); browser2.webBrowser3.Navigate(urlyouTube); browser2.textBoxUrl.Text = urlyouTube; this.Hide(); } else if ((richTextBoxSearch.Text != null && comboBoxItem.Equals("WIKIPEDIA"))) { browser2.Show(); browser2.webBrowser3.Navigate(urlWikipedia); browser2.textBoxUrl.Text = urlWikipedia; this.Hide(); } //else if (richTextBoxSearch.Text == "BING") //{ // browser2.Show(); // browser2.webBrowser3.Navigate("https://www.bing.com/search?q="); // this.Hide(); //} //if (richTextBoxSearch.Text != null && comboxSearchPlatform.Items.Equals("BING")) //{ // browser2.Show(); // browser2.webBrowser3.Navigate("www.bing.com/search=" + richTextBoxSearch.Text); // this.Hide(); //} }