Results 1 to 6 of 6

Thread: question about WebBrowser control?

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2007
    Posts
    5

    question about WebBrowser control?

    I've VB6 code like that :
    vb Code:
    1. WebBrowser1.Document.All("username").Value = "my_username"
    2. WebBrowser1.Document.All("passwd").Value = "my_password"
    3. WebBrowser1.Document.Forms(0).Submit
    4.  
    5. WebBrowser1.Navigate "http://360.yahoo.com"

    So in this code , it'll navigate http://360.yahoo.com before the form is submit to login . So how can I make it navigate another page after the form is already submited and all the page is loaded ?

  2. #2
    Hyperactive Member tommygrayson's Avatar
    Join Date
    Aug 2005
    Location
    In my Nissan Silvia
    Posts
    433

    Re: question about WebBrowser control?

    Quote Originally Posted by ghostshadow189
    I've VB6 code like that :
    vb Code:
    1. WebBrowser1.Document.All("username").Value = "my_username"
    2. WebBrowser1.Document.All("passwd").Value = "my_password"
    3. WebBrowser1.Document.Forms(0).Submit
    4.  
    5. WebBrowser1.Navigate "http://360.yahoo.com"

    So in this code , it'll navigate http://360.yahoo.com before the form is submit to login . So how can I make it navigate another page after the form is already submited and all the page is loaded ?
    In the WebBrowser1 DocumentComplete add:

    Code:
    If Redirected = False Then
         WebBrowser1.Navigate "http://gotosomewheresite.com"
    End If
    Hope that helps.
    Rate Me! Rate Me! Rate Me!

    Time to fly.

    Copyright GraysonSoft Inc. 2007

  3. #3

    Thread Starter
    New Member
    Join Date
    Jun 2007
    Posts
    5

    Re: question about WebBrowser control?

    thanx , but what's Redirected variable ?

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: question about WebBrowser control?

    Quote Originally Posted by ghostshadow189
    thanx , but what's Redirected variable ?
    Where is that coming from?

  5. #5

    Thread Starter
    New Member
    Join Date
    Jun 2007
    Posts
    5

    Re: question about WebBrowser control?

    can u explain more clearly? i c that there no Redirected property of WebBrowser ?

  6. #6
    Hyperactive Member tommygrayson's Avatar
    Join Date
    Aug 2005
    Location
    In my Nissan Silvia
    Posts
    433

    Re: question about WebBrowser control?

    Quote Originally Posted by ghostshadow189
    can u explain more clearly? i c that there no Redirected property of WebBrowser ?
    Redirect is the variable that will stop the browser from doing an infinite navigation.

    In other words:

    Put the code below in your Form_Load:

    Code:
    Dim Redirected as Boolean
    Redirected = False
    Then in your WebBrowser1_DocumentComplete event put the code below:

    Code:
    If Redirected = False Then
         WebBrowser1.Navigate "http://gotosomewheresite.com"
         Redirected = True
    End If
    Rate Me! Rate Me! Rate Me!

    Time to fly.

    Copyright GraysonSoft Inc. 2007

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