如何将Web浏览器的URL放在C#的文本框中? [英] how to put the url of the web browser in textbox in C#?

查看:57
本文介绍了如何将Web浏览器的URL放在C#的文本框中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在文本框中输入网址

我正在使用此代码,但无法正常使用

how to put the url in the textbox

im using this code but it does not work

//form load

webbrowser1.navigate(textbox1.text);


private void webBrowser_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
            textbox1.Text = e.Url.ToString();
}

推荐答案



Hi,

TextBox1.Text=Request.Url.ToString();


如果在文本元素上使用JavaScript,则可能会发生以下情况:
It is possible if you use JavaScript on your text element - such that:
<input type="text" name="textbox1" id="textbox1" value="http://www.google.com" onmouseover="this.style.cursor='pointer' ;" onClick="window.open(this.value);"/>


这篇关于如何将Web浏览器的URL放在C#的文本框中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆