Results 1 to 14 of 14

Thread: WebBrowerOject

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Posts
    247
    Can someone tell me how to reference the webbrowser object?

    Thanks
    Mako Shark
    Great White

  2. #2
    Guest
    Click Project > References... and make sure Microsoft Internet Controls is checked and click OK.

    Here is a little code to get you started:

    Code:
    Dim ie As New InternetExplorer
    
    Private Sub Form_Load()
    ie.Navigate "http://www.vb-world.net
    ie.Visible = True
    End Sub
    A list of stuff will come up as you type "ie."
    You should know what to do from there.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Posts
    247

    Thanks Matthew

    Is this the samething as what Dim did in this posting? I am referring to the last one.

    http://209.207.250.147/showthread.php?threadid=29273

    Thanks
    Mako Shark
    Great White

  4. #4
    Guest
    I didn't know that. This is not Dims. I did write the whole thing out myself to tell you how to do it. I didn't look to find how to do this, I knew it.

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Posts
    247

    Thanks for your effort.

    Sorry for the misunderstanding Matthew. I mean does your code do the samething as Dim. I did not mean you copy Dim's code.
    Mako Shark
    Great White

  6. #6
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Mobile, AL, USA
    Posts
    600

    Different Things

    Hi Shark.

    The code that Matthew provided and D!m's code are two different things. Matthew should you how to reference the Internet Explorer object. D!m's code shows how to create your own webbrowser object (by adding a component to your project rather than a reference). Although the webbrowser object uses the functionality of IE, when you place the object on your form, you have to code the logic for it's operations. This isn't the case with Matthew's example, where you use the IE app itself.

    All the best.

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Posts
    247

    Thanks for your reply OneSource

    Can you show me how to reference it and get start it like Dim?
    Mako Shark
    Great White

  8. #8
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Mobile, AL, USA
    Posts
    600

    Post

    Shark,

    In your VB project, go to Project, Components and select Microsoft Internet Controls (this is the webbrowser object). Draw the control on your form and that's your webbrowser! From there you can use D!m's example (webbrowser1.Navigate2 "www.vb-world.net"). For more info., click here

    All the best.

  9. #9
    Guest
    Sorry for misunderstanding you.

    Can someone tell me how to reference the webbrowser object?
    Referencing a control and adding one to your form are two different things.

    When you reference a control, you can open it externally without having it on your form.

    If you add a control to your form, obviously, you have to use it on your form.

    Here are the basics of the Webbrowser Control, if that's what your going for.

    Code:
    'Go to the previous webpage
    WebBrowser1.GoBack
    'Go to the present webpage
    WebBrowser1.GoForward
    'Go to the default IE home
    WebBrowser1.GoHome
    'Go to the default search page
    WebBrowser1.GoSearch
    'Refresh the current webpage
    WebBrowser1.Refresh
    'Navigate to a webpage
    WebBrowser1.Navigate "www.vb-world.net"
    Hope that helps.

  10. #10

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Posts
    247
    You guys are great!
    Mako Shark
    Great White

  11. #11
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Mobile, AL, USA
    Posts
    600

    Thumbs up Anytime Shark...

    We have to help you because you might bite us if we don't!

  12. #12

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Posts
    247

    Talking Ok, I won't bite you!

    How did Dim get the commands after Document.? There is no drop down for it.

    WebBrowser1.Document.Forms(0).login.Value = "my login name"
    WebBrowser1.Document.Forms(0).passwd.Value = "mypassword"
    WebBrowser1.Document.Forms(0).enter.Click
    Mako Shark
    Great White

  13. #13
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Mobile, AL, USA
    Posts
    600
    Shark,

    D!m probably learned the commands from MSDN or some other reference source. That's one of the weird things that I learned when using the webbrowser object with VB. Although the intellisense (the drop-down lists) didn't work, the commands worked anyway!

    If you search for "webbrowser object" here on VB-World, I'm sure that you can find a lot of useful information.

    All the best.

  14. #14

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Posts
    247

    Talking Your help is appreciated today OneSource.

    You won't get bite from this Great White.
    Mako Shark
    Great White

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