2 Replies - 238 Views - Last Post: 12 January 2013 - 12:09 PM Rate Topic: -----

#1 xxxpetko  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 28
  • Joined: 10-December 12

Code is not working in webbrowser_navigated

Posted 12 January 2013 - 11:10 AM

This code is working in button.click event, but not in webbrowser.navigated. Why ? What I am doing wrong ?
Dim cc As String = 0
        For Each item As String In My.Settings.psites
            If item = site Then
                For Each ele As HtmlElement In CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).document.All
                    If ele.GetAttribute("id").Contains("pass") Then
                        
                        ele.SetAttribute("value", My.Settings.ppass(cc))
                    End If
                Next
            End If
            cc = cc + 1
Next


Thanks for help...

Is This A Good Question/Topic? 0
  • +

Replies To: Code is not working in webbrowser_navigated

#2 lar3ry  Icon User is offline

  • Coding Geezer
  • member icon

Reputation: 310
  • View blog
  • Posts: 1,290
  • Joined: 12-September 12

Re: Code is not working in webbrowser_navigated

Posted 12 January 2013 - 12:03 PM

The event you want is WebBrowser.DocumentCompleted. Navigated occurs when the document beginds to load, so your code is likely looking at an incomplete document.
Was This Post Helpful? 0
  • +
  • -

#3 xxxpetko  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 28
  • Joined: 10-December 12

Re: Code is not working in webbrowser_navigated

Posted 12 January 2013 - 12:09 PM

That's working, Thanks alot ! :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1