Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Web Browser VB.net  (Read 5831 times)

0 Members and 1 Guest are viewing this topic.

almn

  • Guest
Web Browser VB.net
« on: January 20, 2007, 12:09:29 PM »
Hello,

I am creating a web browser, I have most of the things done however I need help with the following:
-When the user clicks on a link that opens a new window I want the new window to open in my browser not IE.

- When I click on a link to a page I would like the adress bar to show the current url(what is the variable for the current page ?)

- what is the variable for all the text in the web page ?

Thanks

Al968

Sidewinder



    Guru

    Thanked: 139
  • Experience: Familiar
  • OS: Windows 10
Re: Web Browser VB.net
« Reply #1 on: January 22, 2007, 12:37:08 PM »
All the text on web page might be:

objIE.document.body.Innertext

There is also an outertext property

The current page address can be found in:

objIE.LocationURL

Note: change objIE to the name of your browser object

 8-)

Question: if you are writing your own browser would you not have to program all the
 properties and methods involved with a browser?
« Last Edit: January 22, 2007, 01:18:40 PM by Sidewinder »
The true sign of intelligence is not knowledge but imagination.

-- Albert Einstein

almn

  • Guest
Re: Web Browser VB.net
« Reply #2 on: January 30, 2007, 03:21:47 PM »
Thanks for your responce,

Now what I was wondering is how to set the shortcut for a button to be the key "enter" (like in IE) so that the browser goes directly to the page when the user presses enter.

Thanks

Al968

Neil



    Expert
  • Fear me Track. Noone can escape my wrath.
  • Thanked: 3
    Re: Web Browser VB.net
    « Reply #3 on: February 01, 2007, 11:38:44 AM »
    Are you creating your "own" own browser, or creating a program using VB's built in stuff to access the Internet? If so then you are basically taking a cut down version of IE anyway, just putting your own stuff around it.

    almn

    • Guest
    Re: Web Browser VB.net
    « Reply #4 on: February 01, 2007, 01:15:23 PM »
    Yes I now I am Using IE and putting my own stuff in  ;)
    Any Advice on the question ??
    Thanks
    Al968

    Sidewinder



      Guru

      Thanked: 139
    • Experience: Familiar
    • OS: Windows 10
    Re: Web Browser VB.net
    « Reply #5 on: February 01, 2007, 02:45:06 PM »
    Perhaps if we had an idea of what you're trying to do this would go a lot easier. Are you trying to program what a user might do, are you trying to scrape data from a web page, are you automating a task, say downloading?

    This is some hefty reading with some invaluable information:
    HTML and DHTML Reference


    Note: IE is scriptable, depending what you're doing, using VB.NET might be a bit overkill.

    Good luck. 8-)
    The true sign of intelligence is not knowledge but imagination.

    -- Albert Einstein

    almn

    • Guest
    Re: Web Browser VB.net
    « Reply #6 on: February 01, 2007, 04:00:40 PM »
    The question I am asking doesn't specificly aplly to a browser. The question is :
    How can I set my program to run code when at any point the user presses the enter key ??

    Thanks

    Al968

    Sidewinder



      Guru

      Thanked: 139
    • Experience: Familiar
    • OS: Windows 10
    Re: Web Browser VB.net
    « Reply #7 on: February 01, 2007, 04:27:07 PM »
    It must have been the post title that threw us off. ;) We I get confused very easily.

    Something like this should work:

    Code: [Select]
    Private Sub txtSelection_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtSelection.KeyPress

      If e.KeyChar = Chr(13) Then

        'enter was pushed, click the submit button
        btnSubmit_Click(sender, e)
      End If
    End Sub

    Note: Any key pressed while txtSelection has focus will run this code so you can trap any key you want to take action on.

    Hope this helps. 8-)
    « Last Edit: February 01, 2007, 04:30:42 PM by Sidewinder »
    The true sign of intelligence is not knowledge but imagination.

    -- Albert Einstein