我的webBrowser中嵌套了一个HTML页面WBTopic.Url = new System.Uri(Directory.GetCurrentDirectory()+"\\Topic.html");此HTML页面中只有一个DIV<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Topic</title>
</head>
<body>
<div id="divTopic">div>
</body>
</html>如何能在这个页面中的div上加入一个文本框?
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Topic</title>
</head>
<body>
<div id="divTopic">div>
</body>
</html>如何能在这个页面中的div上加入一个文本框?
WBTopic.Document.GetElementById("divTopic").InnerHTML="<input type=text />"
把WBTopic.Document.GetElementById("divTopic").InnerHtml = " <input type=text />";
写在DocumentCompleted 事件中就可以了
不要马上用它,以为可能没加载完成:
所以:
System.Threading.Thread.Sleep(500);
WBTopic.Document.GetElementById("divTopic").InnerHtml = " <input type=text />"; OK不?