Results 1 to 4 of 4

Thread: [RESOLVED] Using webbrowser form control by name - Question

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Oct 2000
    Posts
    1,463

    Resolved [RESOLVED] Using webbrowser form control by name - Question

    Hi Everyone,

    I am loading a form in the webbrowser control for the user to check boxes base don their needs. Now I need to read them for values, etc. I was shown how to loop through all of the controls and then for each one do something with. That's not a problem. What I was wondering is if I already have the name of a checkbox control such as chkOne and chkTwo, with code how can I refer to these to get the properties such as checked, value, etc. from without having to loop through and find them?

    Thanks!

  2. #2
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: Using webbrowser form control by name - Question

    I'm not sure I understand whether your checkboxes are part of your VB form or web page?
    If they are standard VB controls on the form then providing parent form name in front of control name is what you need [I guess]:

    Form2.Check1
    Form2.Check2

    ... and so on ...

  3. #3
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: Using webbrowser form control by name - Question

    Use the getElementById function of the Document object.

    debug.Print WebBrowser1.Document.GetElementById("chkOne").Value

    Add a reference to the MS HTML Object Library to your project. You will then have intellisense and can easily find out the different DOM functions available.

  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    Oct 2000
    Posts
    1,463

    Re: Using webbrowser form control by name - Question

    Thanks bruce! Sorry Rhino, it is the checkbox in the html code of the webbrowser control, not a checkbox on the form. I may have not explained it well.

    Checking off resolved!

    Warren

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width