Page 1 of 2 12 LastLast
Results 1 to 40 of 43

Thread: I made a web browers, but.. .

  1. #1

    Thread Starter
    Lively Member Julie_Luvs's Avatar
    Join Date
    Apr 2004
    Location
    Paradise
    Posts
    83

    Question I made a web browers, but.. .

    Hello everyone,

    I am new to this forum as well as VB coding. I was wondering if someone was able to help me.

    I made a web browers, but how can i make it load up a default url when i load the program?

    Thank you for your time.

  2. #2
    Not NoteMe SLH's Avatar
    Join Date
    Mar 2002
    Location
    192.168.0.1 Preferred Animal: Penguin Reason for errors: Line#38
    Posts
    3,051
    How have you made the web browser, what control are you using?
    Quotes:
    "I am getting better then you guys.." NoteMe, on his leet english skills.
    "And I am going to meat her again later on tonight." NoteMe
    "I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
    "my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
    Have I helped you? Please Rate my posts.


  3. #3

    Thread Starter
    Lively Member Julie_Luvs's Avatar
    Join Date
    Apr 2004
    Location
    Paradise
    Posts
    83
    i just got the instructions from here, im not too sure about the vb terms. im sorry im making you goto a url

    http://www.voxcommunications.com/sky/vb_webbrowser.htm

  4. #4
    Not NoteMe SLH's Avatar
    Join Date
    Mar 2002
    Location
    192.168.0.1 Preferred Animal: Penguin Reason for errors: Line#38
    Posts
    3,051
    I'm not at a computer with VB at the moment so i havn't tested this, but try putting this code in your forms Load event:

    WebBrowser1.Navigate ("www.MyDefaultPage.com")
    Quotes:
    "I am getting better then you guys.." NoteMe, on his leet english skills.
    "And I am going to meat her again later on tonight." NoteMe
    "I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
    "my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
    Have I helped you? Please Rate my posts.


  5. #5

    Thread Starter
    Lively Member Julie_Luvs's Avatar
    Join Date
    Apr 2004
    Location
    Paradise
    Posts
    83
    Thank you so much, SLH!

    I tryed that code on all the wrong places, but did not think to do it on the form it self
    :P

    thanks again


  6. #6

    Thread Starter
    Lively Member Julie_Luvs's Avatar
    Join Date
    Apr 2004
    Location
    Paradise
    Posts
    83
    one more question.. . is there a way to make a timer load a url from the browser?

  7. #7
    Frenzied Member
    Join Date
    May 2003
    Location
    So Cal
    Posts
    1,564
    Add the URL to a Timer control

  8. #8
    Member
    Join Date
    Mar 2004
    Location
    Texas
    Posts
    53
    Originally posted by Julie_Luvs
    i just got the instructions from here, im not too sure about the vb terms. im sorry im making you goto a url

    http://www.voxcommunications.com/sky/vb_webbrowser.htm
    Thanks for the link, always like extra tutorials on how to do stuff
    Good programming site:
    *http://www.planet-source-code.com

    Our CS Clan Page:
    *http://h2p.inter-gamer.com/index.html

  9. #9

    Thread Starter
    Lively Member Julie_Luvs's Avatar
    Join Date
    Apr 2004
    Location
    Paradise
    Posts
    83
    Hi, Insane_Magician, thats just a site from school

    ------------------------

    Hi BrianS,
    how do i add a url to a time controler?
    im rather new at vb.


    or does anyone else know how to?

  10. #10
    Not NoteMe SLH's Avatar
    Join Date
    Mar 2002
    Location
    192.168.0.1 Preferred Animal: Penguin Reason for errors: Line#38
    Posts
    3,051
    I'm not too sure what you want to do.

    Do you want to load a specific web page after a given time, say every 5 minutes?
    Quotes:
    "I am getting better then you guys.." NoteMe, on his leet english skills.
    "And I am going to meat her again later on tonight." NoteMe
    "I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
    "my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
    Have I helped you? Please Rate my posts.


  11. #11

    Thread Starter
    Lively Member Julie_Luvs's Avatar
    Join Date
    Apr 2004
    Location
    Paradise
    Posts
    83
    thats correct

  12. #12
    Not NoteMe SLH's Avatar
    Join Date
    Mar 2002
    Location
    192.168.0.1 Preferred Animal: Penguin Reason for errors: Line#38
    Posts
    3,051
    Add a timer control to your form (from the control toolbox), give it an appropriate interval (in seconds), the put the code i gave above into the timer's "Timer" event.
    Quotes:
    "I am getting better then you guys.." NoteMe, on his leet english skills.
    "And I am going to meat her again later on tonight." NoteMe
    "I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
    "my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
    Have I helped you? Please Rate my posts.


  13. #13
    Only Slightly Obsessive jemidiah's Avatar
    Join Date
    Apr 2002
    Posts
    2,431
    Actually, it's in milliseconds (thousandths of a second) . Remember, though, that the maximum interval is 65535 milliseconds (1.09225 minutes). If you want the interval to be over that, you'll need to use some tricks. Otherwise, the timer is fine as it is.
    The time you enjoy wasting is not wasted time.
    Bertrand Russell

    <- Remember to rate posts you find helpful.

  14. #14
    Not NoteMe SLH's Avatar
    Join Date
    Mar 2002
    Location
    192.168.0.1 Preferred Animal: Penguin Reason for errors: Line#38
    Posts
    3,051
    Oops!!

    If you do need an interval longer than that take a look at the SetTimer API, or have a counter variable in a timer with an interval of a minute.
    Quotes:
    "I am getting better then you guys.." NoteMe, on his leet english skills.
    "And I am going to meat her again later on tonight." NoteMe
    "I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
    "my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
    Have I helped you? Please Rate my posts.


  15. #15

    Thread Starter
    Lively Member Julie_Luvs's Avatar
    Join Date
    Apr 2004
    Location
    Paradise
    Posts
    83
    i just need it to be 5 mins, but what do i do from here?


    ---------------------------------------------------------

    Private Sub Timer1_Timer()
    WebBrowser1.Navigate ("www.MyDefaultPage.com")
    End Sub

  16. #16
    Fanatic Member
    Join Date
    Jun 2003
    Location
    Worcester, MA
    Posts
    782
    You could set X=0 then have the timer go for 1000 and every time make x = x + 1 and when it gets to 5 load the page.
    C#.net, VB, C++, Java, VS 2005/2008
    Dont' forget to rate posts that are helpful to you.

  17. #17
    Only Slightly Obsessive jemidiah's Avatar
    Join Date
    Apr 2002
    Posts
    2,431
    Did you mean this:

    VB Code:
    1. Private Sub Form_Load()
    2.     WebBrowser1.Navigate ("http://google.com")
    3.     Timer1.Interval = 10000 '2 second
    4.     Timer1.Enabled = True
    5. End Sub
    6.  
    7.  
    8. Private Sub Timer1_Timer()
    9. Static iCounter As Integer
    10.  
    11.     iCounter = iCounter + 1
    12.     If iCounter = 6 Then
    13.         frmBrowser.Show
    14.         WebBrowser1.Navigate ("http://yahoo.com")
    15.         iCounter = 0 'With your other code and this, every minute the navigate will fire
    16.             'With this line commented out, it will only happen once
    17.     End If
    18.  
    19. End Sub
    The time you enjoy wasting is not wasted time.
    Bertrand Russell

    <- Remember to rate posts you find helpful.

  18. #18
    Only Slightly Obsessive jemidiah's Avatar
    Join Date
    Apr 2002
    Posts
    2,431
    Really? It works fine for me. Could you post your project?
    The time you enjoy wasting is not wasted time.
    Bertrand Russell

    <- Remember to rate posts you find helpful.

  19. #19

    Thread Starter
    Lively Member Julie_Luvs's Avatar
    Join Date
    Apr 2004
    Location
    Paradise
    Posts
    83
    oops im sorry it does load, did not know it takes a min.
    i thought it loads every 2 seconds.

    but the problem is yahoo.com is still refreshing and not stoping
    is there something i did wrong?



    Code:
    Private Sub Form_Load()
    
      WebBrowser1.Navigate ("http://google.com")
        Timer1.Interval = 10000 '2 second
        Timer1.Enabled = True
    End Sub
    
    
    Private Sub Timer1_Timer()
    Static iCounter As Integer
    
        iCounter = iCounter + 1
        If iCounter = 6 Then
        frmBrowser.Show
            WebBrowser1.Navigate ("http://yahoo.com")
            iCounter = 0 'With your other code and this, every minute the navigate will fire
                'With this line commented out, it will only happen once
        End If
    
    End Sub
    Julie Luvs


  20. #20
    Only Slightly Obsessive jemidiah's Avatar
    Join Date
    Apr 2002
    Posts
    2,431
    Comment out the line iCounter = 0 to make it only go to Yahoo once (after 1 minute). The interval multiplied by the control expression's constant in that if (6) is how long it will wait. In this case, it's 10,000 milliseconds times 6 = 60,000 milliseconds = 60 seconds = 1 minute. One other thing you might want to do if it only loads once is to disable the timer after you're done with it.
    The time you enjoy wasting is not wasted time.
    Bertrand Russell

    <- Remember to rate posts you find helpful.

  21. #21

    Thread Starter
    Lively Member Julie_Luvs's Avatar
    Join Date
    Apr 2004
    Location
    Paradise
    Posts
    83
    im not too sure how to do this. may you please give me an example on how to stop timer?
    Julie Luvs


  22. #22
    Only Slightly Obsessive jemidiah's Avatar
    Join Date
    Apr 2002
    Posts
    2,431
    On how to make it only navigate to Yahoo 1 time after 1 minute:

    VB Code:
    1. Private Sub Form_Load()
    2.  
    3.   WebBrowser1.Navigate ("http://google.com")
    4.     Timer1.Interval = 10000 '2 second
    5.     Timer1.Enabled = True
    6. End Sub
    7.  
    8.  
    9. Private Sub Timer1_Timer()
    10. Static iCounter As Integer
    11.  
    12.     iCounter = iCounter + 1
    13.     If iCounter = 6 Then
    14.     frmBrowser.Show
    15.         WebBrowser1.Navigate ("http://yahoo.com")
    16.         Timer1.Enabled = False
    17.     End If
    18.  
    19. End Sub

    I hope I've answered what you asked. If not, just elaborate and I'll do it again
    The time you enjoy wasting is not wasted time.
    Bertrand Russell

    <- Remember to rate posts you find helpful.

  23. #23

    Thread Starter
    Lively Member Julie_Luvs's Avatar
    Join Date
    Apr 2004
    Location
    Paradise
    Posts
    83
    it works!!
    Thank you so much, you were a great help!
    Julie Luvs


  24. #24

    Thread Starter
    Lively Member Julie_Luvs's Avatar
    Join Date
    Apr 2004
    Location
    Paradise
    Posts
    83
    ok now i got another question, how can i make it load a third URL?
    Julie Luvs


  25. #25
    Only Slightly Obsessive jemidiah's Avatar
    Join Date
    Apr 2002
    Posts
    2,431
    Something like.....

    VB Code:
    1. Private Sub Form_Load()
    2.  
    3.   WebBrowser1.Navigate ("http://google.com")
    4.     Timer1.Interval = 10000 '2 second
    5.     Timer1.Enabled = True
    6. End Sub
    7.  
    8.  
    9. Private Sub Timer1_Timer()
    10. Static iCounter As Integer
    11.  
    12.     iCounter = iCounter + 1
    13.     If iCounter = 6 Then
    14.         frmBrowser.Show
    15.         WebBrowser1.Navigate ("http://yahoo.com")
    16.     End If
    17.     If iCounter = 12 Then
    18.         frmBrowser.Show
    19.         WebBrowser1.Navigate ("http://cnn.com")
    20.         Timer1.Enabled = False
    21.     End If
    22. End Sub

    This'll originally go to Google, then, after 1 minute, Yahoo, and then, after another minute, CNN.com.
    The time you enjoy wasting is not wasted time.
    Bertrand Russell

    <- Remember to rate posts you find helpful.

  26. #26

    Thread Starter
    Lively Member Julie_Luvs's Avatar
    Join Date
    Apr 2004
    Location
    Paradise
    Posts
    83
    how many seconds is:

    Timer1.Interval = 10000

    Julie Luvs


  27. #27
    Only Slightly Obsessive jemidiah's Avatar
    Join Date
    Apr 2002
    Posts
    2,431
    10.

    The Interval property is in milliseconds which are thousandths of a second. Therefore, 1000 ms (abbreviation for milliseconds) = 1 second. 10 seconds = 10,000 ms.
    The time you enjoy wasting is not wasted time.
    Bertrand Russell

    <- Remember to rate posts you find helpful.

  28. #28

    Thread Starter
    Lively Member Julie_Luvs's Avatar
    Join Date
    Apr 2004
    Location
    Paradise
    Posts
    83
    ahhh i get it now, i was so confused before
    lol
    Julie Luvs


  29. #29

    Thread Starter
    Lively Member Julie_Luvs's Avatar
    Join Date
    Apr 2004
    Location
    Paradise
    Posts
    83
    my math is really bad, please help


    360000 ms = 6 min
    ?
    Julie Luvs


  30. #30
    Only Slightly Obsessive jemidiah's Avatar
    Join Date
    Apr 2002
    Posts
    2,431
    Yes. Doing it in steps: 6 minutes = 6*60 seconds = 360 seconds. 360 seconds = 360 * 1000 ms = 360000.
    The time you enjoy wasting is not wasted time.
    Bertrand Russell

    <- Remember to rate posts you find helpful.

  31. #31

    Thread Starter
    Lively Member Julie_Luvs's Avatar
    Join Date
    Apr 2004
    Location
    Paradise
    Posts
    83
    is there a way i can load up a .txt file of URLs
    then after every 6 mins it changes URLs?


    if its too much to type out for examples, can you tell me what keyword i need to look up or what is the command name called?

    thanks
    Last edited by Julie_Luvs; Apr 4th, 2004 at 10:20 PM.
    Julie Luvs


  32. #32

    Thread Starter
    Lively Member Julie_Luvs's Avatar
    Join Date
    Apr 2004
    Location
    Paradise
    Posts
    83
    maximum interval is 65535 milliseconds (1.09225 minutes)

    what can i use if i want the timer to be 6 mins long?
    Julie Luvs


  33. #33
    Hyperactive Member
    Join Date
    Nov 2003
    Location
    In Front of my computer...
    Posts
    367
    VB Code:
    1. 'create a Timer on your form and set Interval = 1000 (1 second or whatever)
    2. Private Sub Timer1_Timer()
    3. Static intCounter As Integer
    4.  
    5.     intCounter = intCounter + 1
    6.     If intCounter = 360000 Then '6minutes as passed
    7.         WrbBrowser.Navigate "www.google.com"
    8.         intCounter = 0
    9.     End If
    10.  
    11. End Sub
    Born to help others
    (If I've been helpful then please rate my post. Thanks)

    call me EJ or be slapped!

  34. #34

    Thread Starter
    Lively Member Julie_Luvs's Avatar
    Join Date
    Apr 2004
    Location
    Paradise
    Posts
    83
    i have no idea what i am doing.. . can you check what is wrong?
    i been up all night trying to get this to work



    Code:
    Private Sub Form_Load()
    
        Timer1.Interval = 1000  '1 sec
        Timer1.Enabled = True
        
    End Sub
    
    
    'create a Timer on your form and set Interval = 1000 (1 second or whatever)
    Private Sub Timer1_Timer()
    Static intCounter As Integer
    
        intCounter = intCounter + 1
        If intCounter = 1000 Then '6minutes as passed
            WebBrowser.Navigate ("www.google.com")
            intCounter = 0
        End If
    
    End Sub
    Julie Luvs


  35. #35
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246
    Well, that won't work because Integers can only hold a maximum of 32767.

    I think you are better off using a string (what is the maximum for a Long?)

    VB Code:
    1. Private Sub Form_Load()
    2.  
    3.     Timer1.Interval = 1000  '1 sec
    4.     Timer1.Enabled = True
    5.    
    6. End Sub
    7.  
    8.  
    9. 'create a Timer on your form and set Interval = 1000 (1 second or whatever)
    10. Private Sub Timer1_Timer()
    11. Static strCounter As String
    12. Dim add As String
    13. add = "1"
    14.  
    15.     strCounter = strCounter + add
    16.     If strCounter ="360000" Then '6minutes as passed
    17.         WebBrowser.Navigate ("www.google.com")
    18.         intCounter = 0
    19.     End If
    20.  
    21. End Sub

    Phreak

    Visual Studio 6, Visual Studio.NET 2005, MASM

  36. #36

    Thread Starter
    Lively Member Julie_Luvs's Avatar
    Join Date
    Apr 2004
    Location
    Paradise
    Posts
    83
    im kind of slow on this, give me a few and ill let you know how it works out for me
    Julie Luvs


  37. #37

    Thread Starter
    Lively Member Julie_Luvs's Avatar
    Join Date
    Apr 2004
    Location
    Paradise
    Posts
    83
    i tryed the code provied, but it failed to load the webpage.
    any idea what i maybe doing wrong?
    Julie Luvs


  38. #38

    Thread Starter
    Lively Member Julie_Luvs's Avatar
    Join Date
    Apr 2004
    Location
    Paradise
    Posts
    83
    im still not able to get it to work.
    im sorry, i know im starting to get anoying.
    Julie Luvs


  39. #39
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246
    Change strCounter (or intCounter) to Currency.

    VB Code:
    1. Dim strCounter As Currency
    2. Private Sub Form_Load()
    3.  
    4.     Timer1.Interval = 1000  '1 sec
    5.     Timer1.Enabled = True
    6.    
    7. End Sub
    8.  
    9.  
    10. 'create a Timer on your form and set Interval = 1000 (1 second or whatever)
    11. Private Sub Timer1_Timer()
    12.     hAdd strCounter, "1000"
    13.     MsgBox strCounter
    14.     If strCounter = "360000" Then '6minutes as passed
    15.         WebBrowser1.Navigate2 "www.google.com"
    16.         strCounter = "0"
    17.     End If
    18.  
    19. End Sub
    20.  
    21. Sub hAdd(a As Variant, b As Variant)
    22. strCounter = a + b
    23. End Sub

    I have to sleep now, so thats the best I can come up with.

    Phreak

    Visual Studio 6, Visual Studio.NET 2005, MASM

  40. #40

    Thread Starter
    Lively Member Julie_Luvs's Avatar
    Join Date
    Apr 2004
    Location
    Paradise
    Posts
    83
    Thank you for your time, sleep well.


    -------------------

    does anyone know where i should edit if i wanted to make it 6 mins?

    hAdd strCounter, "1000" <---here?
    MsgBox strCounter
    If strCounter = "5000" Then '6minutes as passed <----or here?
    Julie Luvs


Page 1 of 2 12 LastLast

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