Results 1 to 11 of 11

Thread: Any tips for a High School Senior creating a Web Browser for his Senior Project

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2013
    Posts
    7

    Any tips for a High School Senior creating a Web Browser for his Senior Project

    I've made web browsers in the past, and figured it would be a fun way to demonstrate the effectiveness of hands-on teaching in the class room as opposed to lecturing. It's how I was taught in my computer programming class, so I'm demonstrating the potential for creativity and initiative in students taught with the hands-on method by creating a web browser in Visual Basic. I've been following this tutorial pretty closely: http://www.youtube.com/watch?v=J_uCrc_w5ZQ

    This is what I have so far:
    A basic "Tabs" system
    Good looking graphic icons for navigation
    An "About" page
    Printing capabilities
    Search capabilities

    I plan on adding:
    A splash screen
    A combobox address bar with navigation suggestions
    A loading progress bar
    A favorites/bookmarks system
    A history system

    I realize that the knowledge base on this website is far greater than my own, and I'd love to hear suggestions from anyone willing to give them.

    Things I'm looking for:
    Anything to speed up and enhance performance
    Anything you think will make my browser better
    Appearance suggestions
    GUI Enhancements
    Pretty much anything

    Thanks ahead of time!!
    - Jon

  2. #2

    Re: Any tips for a High School Senior creating a Web Browser for his Senior Project

    This may or may not be the appropriate sub-forum, but I could be mistaken. But I digress...

    In the CodeBank, I believe there is a Tabbed Web Browser sample that you can look at and adapt for your needs that will address what you want. Most of what you're looking to implement seems to be working, which is great, and honestly the most I think that could be done from us is code review (which I believe there is a sub-forum for somewhere...).

    Speed enhancements could be anything and everything honestly. It's one of those things that requires a peek at the code to give optimization suggestions, or if there even need to be any. Are there specific functions/parts of this project that seem slow/act slow?

  3. #3

    Thread Starter
    New Member
    Join Date
    Nov 2013
    Posts
    7

    Re: Any tips for a High School Senior creating a Web Browser for his Senior Project

    Thanks for your reply! I'll be sure to take a look at that sample. And to answer your question, not really. Just wondering if there were any small things you can add in to make it run faster. I do have one question in specific however. Whenever I maximize my form while it's running, all of the components stay where I placed them and don't move in accordance to the maximization. For example, when I click maximize I would have a very short URL bar. How do I make it so these components move upon resize?

  4. #4

    Re: Any tips for a High School Senior creating a Web Browser for his Senior Project

    You need to set the Anchor property of the controls accordingly in your IDE. It's under the properties pane where you can set what sides the control will anchor to. This will allow you to have controls that stretch and move with the form.

  5. #5

    Thread Starter
    New Member
    Join Date
    Nov 2013
    Posts
    7

    Re: Any tips for a High School Senior creating a Web Browser for his Senior Project

    Thanks works great now! Any suggestions on how to make my browser different from other browsers are also appreciated.

  6. #6

    Re: Any tips for a High School Senior creating a Web Browser for his Senior Project

    Quote Originally Posted by Jon_E29 View Post
    Thanks works great now! Any suggestions on how to make my browser different from other browsers are also appreciated.
    Always happy to help.

    Unfortunately, I'm not the most creative individual for UI designs that make your browser look/act different/better than others. I leave that to the other members of the forum that have that sort of creativity.

  7. #7

    Thread Starter
    New Member
    Join Date
    Nov 2013
    Posts
    7

    Re: Any tips for a High School Senior creating a Web Browser for his Senior Project

    Okay so I'm having some trouble here. I'm trying to add a history function, but running into some serious problems. I'm trying to make it so that everytime the browser is navigated, the url is converted to a string, saved in my.settings.history, and then my.settings.history is able to be displayed in a seperate form meant for history. Since the web browser actually works through a tabcontrol, i don't know what to call the browser.

    My.Settings.History is a Specialized String Collection
    Here is my creation of the tabcontrol browser:

    Code:
    Private Sub EliteBrowser_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    
            TabControl1.TabPages.Add("New Page")
            Browser.Name = "Web Browser"
            Browser.Dock = DockStyle.Fill
            TabControl1.SelectedTab.Controls.Add(Browser)
            AddHandler Browser.DocumentCompleted, AddressOf Done
            int = int + 1
            CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).Navigate(My.Settings.Homepage)
    
        End Sub
    Here's what I'm trying to do:


    Code:
    Private Sub Browser_Navigated(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserNavigatedEventArgs) Handles WebBrowser.Navigated
            My.Settings.History.Add(Browser.Url.ToString)
        End Sub
    I realize I could also use document completed declaration, but I still wouldn't know what to call the browser by.
    Help needed

  8. #8

    Re: Any tips for a High School Senior creating a Web Browser for his Senior Project

    Just so you know, the "sender" object, in this case, is the WebBrowser that has raised the Navigated event. So you can cast sender to a WebBrowser via CType() [ or even DirectCast() in this case ] and that's the browser that has navigated!

    You should also learn about MSDN. The reason is that you see the 2nd argument is "e", which, in this case, is the WebBrowserNavigatedEventArgs class, which happens to have a property of "Url". So you can do "My.Settings.History.Add(e.Url)"!


    EDIT: You also might want to do an AddHandler for the Navigated event, just like you did for DocumentCompleted!

  9. #9

    Thread Starter
    New Member
    Join Date
    Nov 2013
    Posts
    7

    Re: Any tips for a High School Senior creating a Web Browser for his Senior Project

    I'm still kind of lost with that idea. Would you mind writing an example code with that in it ?

  10. #10

    Thread Starter
    New Member
    Join Date
    Nov 2013
    Posts
    7

    Re: Any tips for a High School Senior creating a Web Browser for his Senior Project

    Heres what I was able to come up with for the code. It's not giving me any errors, but its not working. Or it is working and I'm just not seeing it. I'm trying to display the Specialized String Collection (My.Settings.History) in a listbox on a seperate form (see below), but the urls aren't appearing in the listbox when I test it out.

    Code:
    Private Sub WebBrowser_Navigated(sender As WebBrowser, e As WebBrowserNavigatedEventArgs)
            Dim item1 As String
            item1 = e.Url.ToString()
            My.Settings.History.Add(item1)
        End Sub
    Code:
    Public Class HistoryForm
    
        Private Sub HistoryForm_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            ListBox1.DataSource = My.Settings.History
        End Sub
    End Class

  11. #11

    Re: Any tips for a High School Senior creating a Web Browser for his Senior Project

    Typically, I'd just add items to the ListBox, then when closing the form, just add the items to the History collection and save them. However, your implementation may vary. You might want to look at setting breakpoints to see what My.Settings.History contains while loading.

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