Results 1 to 9 of 9

Thread: Visual Basic 2010 - Unhandled Exceptions, Please Help

Threaded View

  1. #7

    Thread Starter
    Lively Member
    Join Date
    Jun 2012
    Posts
    75

    Re: Visual Basic 2010 - Unhandled Exceptions, Please Help

    example code with issue:


    If inputidval.Text <> "" And inputid.Checked Then
    On Error Resume Next
    WebBrowser1.Document.GetElementById(inputidval.Text).SetAttribute("Value", inputidnew.Text)
    End If
    End Sub


    when the user puts in a name thats not valid, it would return errors
    if the name they put in wasnt available in webbrowser1.document

    not sure how to resolve it other than the on error resume next thing, it
    worked, is there a better solution?

    im not sure how to write the io.file.exists statement for
    WebBrowser1.Document.GetElementById(inputidval.Text).SetAttribute("Value", inputidnew.Text)

    sounds hard.. :/

    heres a working snippet / example app code


    Dim CodeElements As HtmlElementCollection = WebBrowser1.Document.All
    For Each codeElement As HtmlElement In CodeElements
    Dim code2Element As String = codeElement.GetAttribute("src").ToString
    If code2Element <> "" And codeid.Checked Then
    txtID.Text += "HTML SOURCE: "
    txtID.Text += code2Element
    txtID.Text += vbCrLf
    numElement += 1
    txtElements.Text = numElement
    End If


    if it helps / request for code

    thanks for responding.
    Last edited by VBbbq; Jun 20th, 2012 at 11:50 PM.

Tags for this Thread

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