Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7997859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T15:04:07+00:00 2026-06-04T15:04:07+00:00

In VB6 classical, we could do: Private Sub Form_Load() WebBrowser1.Navigate2 http://yourSite.com End Sub Private

  • 0

In VB6 classical, we could do:

Private Sub Form_Load()
     WebBrowser1.Navigate2 "http://yourSite.com"
End Sub

Private Sub Command1_Click()
With Webbrowser1
     .Document.All("fieldName").Value = "some value"
     'click the button
     .Document.All("fieldName").Click
End With

End Sub

However in VB.Net, we get error that there is no Value property, so I tried:

  With wb
     ' fill From field
     .Document.All("fieldName").SetAttribute("Value", strFrom)
     ' click the button now
     .Document.All("fieldName").RaiseEvent("Click")
  End With

But even that generates an error:

Object reference not set to an instance of an object.

On line:

.Document.All("fieldName").SetAttribute("Value", strFrom)

How to do same thing in VB.net ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T15:04:10+00:00Added an answer on June 4, 2026 at 3:04 pm

    I remember the old VB6 way, if you want to invoke a HTML Element’s click event in VB.Net code:

    Private Function ClickSubmitButton()
    
    Dim theButton As HtmlElement
    
    Try
    
    ' Link the ID from the web form to the Button var
    theButton = webbrowser1.Document.GetElementById("loginbutton")
    
    ' Now do the actual click.
    theButton.InvokeMember("click")
    Return True
    
    Catch ex As Exception
    
    Return False
    
    End Try
    
    End Function
    

    With setting attributes, try this as an example (off the top of my head):

    Dim textArea = webBrowser1.Document.All("foo")
    If textArea <> Nothing Then
    textArea.InnerText = "This is a test"
    End IF
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a legacy VB6 component that was com+/MTS and is used by asp
We have a Com+ VB6 DLL used in our asp classic application. After upgrading
Using VB6 Using MDI Forms, sub Forms also When I run the Software in
I have an ASP Classic application which references some VB6 COM OBJECTS. One of
We are moving a classic ASP application with VB6 COM objects, over to the
It is my understanding that for a VB6 COM object when it goes out
In VB6, how can I loop through all the .frm files in a folder
In VB6/VBA, you can declare module-level variables outside of a specific Sub or Function
We have a number of classic ASP websites using a VB6 DLL (COM) object
In VB6 it is possible to prepand array identifiers with an empty array index.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.