<input type="checkbox" id="PandE" name="PopEsmtp" value="1" onclick="checkPopStat(this)" /><label for="PandE" >服务</label>
<input type="checkbox" name="popmyFolder" id="popmyFolder" value="1" checked disabled/><label for="popmyFolder">我的文件夹</label>
<input type="checkbox" name="popbookMail" id="popbookMail" value="1" checked disabled/><label for="popbookMail">邮件订阅</label>
<input type="checkbox" name="popjunkMail" id="popjunkMail" value="1" disabled/><label for="popjunkMail">垃圾邮件</label>
<input type="checkbox" name="savesend_esmtp" id="savesend_esmtp" value="1" disabled/><label for="savesend_esmtp">保存</label>
这个多选框怎么填写啊? 只要选中第一个就可以了WebBrowser1.Document.getElementById("PandE").Checked = True 提示变量未设置。
<input type="checkbox" name="popmyFolder" id="popmyFolder" value="1" checked disabled/><label for="popmyFolder">我的文件夹</label>
<input type="checkbox" name="popbookMail" id="popbookMail" value="1" checked disabled/><label for="popbookMail">邮件订阅</label>
<input type="checkbox" name="popjunkMail" id="popjunkMail" value="1" disabled/><label for="popjunkMail">垃圾邮件</label>
<input type="checkbox" name="savesend_esmtp" id="savesend_esmtp" value="1" disabled/><label for="savesend_esmtp">保存</label>
这个多选框怎么填写啊? 只要选中第一个就可以了WebBrowser1.Document.getElementById("PandE").Checked = True 提示变量未设置。
或对其内容进行修改等,这肯定会触发该<input>的某些事件,如果是做网页的话就很好办,写个VBScript就可以
了.而我希望能在WebBrowser所在的VB程序中接收到这些事件,然后在这些事件中用VB程序响应.不知这样可
不可能
Private Sub WB_NavigateComplete2(ByVal pDisp As Object, URL As Variant)
Dim i, j
Dim xo, yo
For i = 0 To WB.Document.All.length - 1
If UCase(WB.Document.All(i).tagName) = "INPUT" Then
Set xo = WB.Document.All(i)
If LCase(xo.Type) = "text" Then
xo.Value = "OKOK"
End If
End If
If WB.Document.All(i).tagName = "TEXTAREA" Then
Set xo = WB.Document.All(i)
xo.Value = "Textarea"
End If
Next i
End SubPrivate Sub Command5_Click()
Dim vDoc, vTag
Dim i As Integer
Set vDoc = WB.Document
For i = 0 To vDoc.All.length - 1
If UCase(vDoc.All(i).tagName) = "INPUT" Then
Set vTag = vDoc.All(i)
If LCase(vTag.Type) = "submit" Then
Debug.Print "sub"
vTag.Select
vTag.Click
Exit Sub
End If
End If
Next i
End SubPrivate Sub Command1_Click()
WB.Navigate "www.yahoo.com.cn"
End SubWB是Webbrowser控件,点击Command1浏览 Command5点击按钮。首先你需要在
References定义中加入Microsoft HTML Object Library
WBDocument.body.All("PopEsmtp").Checked = 1这个可以了!!