请教,任何把textbox里输入的值传给value。也就是 textbox = value下面代码:Private Sub Text1_Change()End SubDim m As Integer
Set vDoc = WebBrowser1.Document
For m = 0 To vDoc.All.length - 1 '检测所有标签
If UCase(vDoc.All(m).tagName) = "INPUT" Then '找到input标签
Set vTag = vDoc.All(m)
If vTag.Type = "text" Then  '看看是不是我们需要的
Select Case vTag.Name '按标签的名字,对号操做
Case "Login1$txtExtCode"
vTag.Value = ""
End Select
End If
End If
Next m想把 vTag.Value = 的值等于 Text1 输入的值。先在此谢谢各位了。

解决方案 »

  1.   

    vTag.Value 这个值恐怕有一定要求吧,我没试过,能否=Text1.Text? 
      

  2.   


    vTag.Value = "Text1.Text" 或者 vTag.Value = Text1.Text 都不可以,我自己认为好像需要先定义 Value=Text1 然后才能 vTag.Value = Text1.Text 
      

  3.   

    vTag.Value = "Text1.Text" 都不可以,我自己认为好像需要先定义 Value=Text1 然后才能 vTag.Value = Text1.Text 
      

  4.   

    我已经测试过了,没有问题Private Sub Command1_Click()
        Dim m As Integer
        Set vDoc = WebBrowser1.Document
        For m = 0 To vDoc.All.length - 1 '检测所有标签
            If UCase(vDoc.All(m).tagName) = "INPUT" Then '找到input标签
                Set vTag = vDoc.All(m)
                If vTag.Type = "text" Then  '看看是不是我们需要的
                    Select Case vTag.Name '按标签的名字,对号操做
                    Case "Login1$txtExtCode"
                    vTag.Value = Text1.Text
                    End Select
                End If
            End If
        Next m
    End SubPrivate Sub Form_Load()
    WebBrowser1.Navigate ("I:\TEMP\HT.HTML")
    End Subht.html内容如下:
    <html><body>Please enter your name:<br/>
    <input type='text' name='userName'/><br/>
    <a href='http://www.microsoft.com'>continue</a><br/>
    <br/>
    <input type='text' name='Login1$txtExtCode'/><br/>
    </body></html>
      

  5.   

    感谢 jameslan520 ,完全可以使用。