我想Webbroswer 显示自己定义的数据源怎么做? 譬如 “天津”这两个字显示在webbroswe上,并且这两字要是超链接。 帮帮忙 在线等!
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
webBrowser1.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(webBrowser1_DocumentCompleted);
webBrowser1.Navigate("about:blank ");
}
void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
if (string.IsNullOrEmpty(webBrowser1.Document.Body.InnerHtml))
{
webBrowser1.Document.Body.InnerHtml = "<a href='http://baidu.com'>天津</a>";
}
}
}