I am creating a webbrowser. If we ente googl in our url after press ctrl + enter . it will show www.google.com. But ctrl + Enter is not working. i m using this code but it is not working
Code:
private void txtURL_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { GoTo(txtURL.Text); } } private void GoTo(String strUrl) { if (String.IsNullOrEmpty(strUrl)) return; if (strUrl.Equals("about:blank")) return; if (!strUrl.StartsWith("http://")) strUrl = "http://" + strUrl; try { webBrowser1.Navigate(new Uri(strUrl)); } catch (System.UriFormatException) { return; } }
Comment