1 Replies - 373 Views - Last Post: 18 January 2013 - 05:30 PM

#1 singh101  Icon User is offline

  • New D.I.C Head

Reputation: -2
  • View blog
  • Posts: 25
  • Joined: 17-January 13

I get errors saying this doesn't work

Posted 18 January 2013 - 05:12 PM

Public Class Form1

    Private Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
        WebBrowser2.document.GetElementById("username").SetAttribute("value", TextBox1.Text)
        WebBrowser2.document.GetElementById("password").SetAttribute("value", TextBox2.Text)


        Dim Elements As HtmlElementCollection = WebBrowser2.document.All
        For Each webpageelement As HtmlElement In Elements
            If webpageelement.GetAttribute("value") = "Login" Then
                webpageelement.InvokeMember("click")
            End If
        Next



    End Sub

    Private Sub Button2_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button2.Click
        WebBrowser2.document.window.Domwindow.execscript("alert('Hello World!');", "Javascript")

    End Sub

    Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click

    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        For Each webpageelement As HtmlElement
            webpageelement.GetAttribute("value") = "youtubeiv")Then
            webpageelement.InvokeMember("click")
        Next
    End Sub
    End Class


Is This A Good Question/Topic? 0
  • +

Replies To: I get errors saying this doesn't work

#2 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3635
  • View blog
  • Posts: 5,756
  • Joined: 08-June 10

Re: I get errors saying this doesn't work

Posted 18 January 2013 - 05:30 PM

You already have a thread open for this topic (two, actually). Do not post your questions multiple times! Use your existing thread if you want to continue discussing this topic.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1