Many Things

Posts 1–8 of 8 · Page 1 of 1
Many Things
I am currently making a very advanced web browser, and it would be helpful if you guys could... help me =).


The first thing is:

I have a new tab option, but when I enter a site into the textbox to go the that site, it goes in the first tab. I want to know how to make it work for the tab that I am on.

The second thing is:

I want to know how to do the save option for a webpage.

The third thing is:

How to put in an option to change the backround color of the webbrowser.

The Fourth thing is:

How to make a button set the current page to your home page, or manually enter a page to make your home page.

The Fifth thing is:

Anything else that you can think of that would be cool to add!!!

Thanks for all the help,

PJ
first of all Im going to tell you: "Don't use .NET webbrowser", otherwise, nothing will be advanced... -.-

Use for example this: GeckoFX Forum / GeckoFX Discussion

if you are actually good at VB and want to make something, i guess you wont need an explanation on that..
Quote Originally Posted by 'Bruno View Post
first of all Im going to tell you: "Don't use .NET webbrowser", otherwise, nothing will be advanced... -.-

Use for example this: GeckoFX Forum / GeckoFX Discussion

if you are actually good at VB and want to make something, i guess you wont need an explanation on that..
Not what I was looking for... but ok...
Quote Originally Posted by pjrat111 View Post
Not what I was looking for... but ok...
dude do you even saw what is that? obviously not... w/e if you want to keep with ir crap .net browser.. go for it.. (btw thats the engine used on firefox, if not wrong)
Quote Originally Posted by 'Bruno View Post
dude do you even saw what is that? obviously not... w/e if you want to keep with ir crap .net browser.. go for it.. (btw thats the engine used on firefox, if not wrong)
I'm sorry, I don't understand you very well. I don't use VB.net, and I have no idea what you are talking about. I am talking about VISUAL BASIC 2010.
Quote Originally Posted by pjrat111 View Post
I am currently making a very advanced web browser, and it would be helpful if you guys could... help me =).


The first thing is:

I have a new tab option, but when I enter a site into the textbox to go the that site, it goes in the first tab. I want to know how to make it work for the tab that I am on.

The second thing is:

I want to know how to do the save option for a webpage.

The third thing is:

How to put in an option to change the backround color of the webbrowser.

The Fourth thing is:

How to make a button set the current page to your home page, or manually enter a page to make your home page.

The Fifth thing is:

Anything else that you can think of that would be cool to add!!!

Thanks for all the help,

PJ
1.
Code:
Public Class Form1

    Dim CurrBrowser As WebBrowser


    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        
        Me.TabControl1.TabPages.Clear()
        AddTab("Neuer Tab...", "about:blank")

    
        GetCurrBrowser()

    End Sub

    Private Sub ComboBox1_KeyDown(ByVal sender As System.Object, ByVal e As KeyEventArgs) Handles ComboBox1.KeyDown

      
        If e.KeyCode = Keys.Enter Then
            CurrBrowser.Navigate(Me.ComboBox1.Text)
            Me.ComboBox1.Items.Add(Me.ComboBox1.Text)
        End If

    End Sub

    Private Sub TabPage1_TabIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TabControl1.TabIndexChanged
        GetCurrBrowser()
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

     
        AddTab("Neuer Tab...", "about:blank")

    End Sub

    Private Sub wb_DocumentCompleted(ByVal sender As Object, ByVal e As WebBrowserDocumentCompletedEventArgs)

 
        Me.TabControl1.SelectedTab.Text = CurrBrowser.DocumentTitle

        
        If e.Url.AbsoluteUri = "about:blank" Then
            Me.TabControl1.SelectedTab.Text = "New Tab..."
        End If

    End Sub

    Private Sub wb_Navigating(ByVal sender As Object, ByVal e As WebBrowserNavigatingEventArgs)

        Me.ComboBox1.Text = CurrBrowser.Url.AbsoluteUri

    End Sub

    Private Sub wb_Navigated(ByVal sender As Object, ByVal e As WebBrowserNavigatedEventArgs)

        ' add to list

        Me.ComboBox1.Text = CurrBrowser.Url.AbsoluteUri

    End Sub

    Sub AddTab(ByVal name As String, ByVal url As String)

        Dim tab As TabPage = New TabPage(name)
        Dim wb As WebBrowser = New WebBrowser

        ' navigate to url
        wb.Navigate(url)
        wb.Dock = DockStyle.Fill

        ' move browser to tab
        tab.Controls.Add(wb)

      
        AddHandler wb.DocumentCompleted, AddressOf wb_DocumentCompleted
        AddHandler wb.Navigating, AddressOf wb_Navigating
        AddHandler wb.Navigated, AddressOf wb_Navigated

        ' add to tabcontrol
        Me.TabControl1.TabPages.Add(tab)

    End Sub

    Sub GetCurrBrowser()

        ' CurrBrowser set to selected tab
        For Each wb As WebBrowser In Me.TabControl1.SelectedTab.Controls
            CurrBrowser = wb
            Exit For
        Next

    End Sub
End Class
2. What do you mean, like password saving? You may do a encrypted listbox or so =/.

3. Background of the page itself or the webbrowser...

4. Use My.Settings...make a new string..i.e. homepage

when saving the settings...

Code:
My.settings.homepage = textbox1.text
my.settings.save
my.settings.reload
on form_load

Code:
webbrowser1.navigate(my.settings.homepage)
5. Favourites/History etc.
Quote Originally Posted by Blubb1337 View Post
1.
Code:
Public Class Form1

    Dim CurrBrowser As WebBrowser


    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        
        Me.TabControl1.TabPages.Clear()
        AddTab("Neuer Tab...", "about:blank")

    
        GetCurrBrowser()

    End Sub

    Private Sub ComboBox1_KeyDown(ByVal sender As System.Object, ByVal e As KeyEventArgs) Handles ComboBox1.KeyDown

      
        If e.KeyCode = Keys.Enter Then
            CurrBrowser.Navigate(Me.ComboBox1.Text)
            Me.ComboBox1.Items.Add(Me.ComboBox1.Text)
        End If

    End Sub

    Private Sub TabPage1_TabIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TabControl1.TabIndexChanged
        GetCurrBrowser()
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

     
        AddTab("Neuer Tab...", "about:blank")

    End Sub

    Private Sub wb_DocumentCompleted(ByVal sender As Object, ByVal e As WebBrowserDocumentCompletedEventArgs)

 
        Me.TabControl1.SelectedTab.Text = CurrBrowser.DocumentTitle

        
        If e.Url.AbsoluteUri = "about:blank" Then
            Me.TabControl1.SelectedTab.Text = "New Tab..."
        End If

    End Sub

    Private Sub wb_Navigating(ByVal sender As Object, ByVal e As WebBrowserNavigatingEventArgs)

        Me.ComboBox1.Text = CurrBrowser.Url.AbsoluteUri

    End Sub

    Private Sub wb_Navigated(ByVal sender As Object, ByVal e As WebBrowserNavigatedEventArgs)

        ' add to list

        Me.ComboBox1.Text = CurrBrowser.Url.AbsoluteUri

    End Sub

    Sub AddTab(ByVal name As String, ByVal url As String)

        Dim tab As TabPage = New TabPage(name)
        Dim wb As WebBrowser = New WebBrowser

        ' navigate to url
        wb.Navigate(url)
        wb.Dock = DockStyle.Fill

        ' move browser to tab
        tab.Controls.Add(wb)

      
        AddHandler wb.DocumentCompleted, AddressOf wb_DocumentCompleted
        AddHandler wb.Navigating, AddressOf wb_Navigating
        AddHandler wb.Navigated, AddressOf wb_Navigated

        ' add to tabcontrol
        Me.TabControl1.TabPages.Add(tab)

    End Sub

    Sub GetCurrBrowser()

        ' CurrBrowser set to selected tab
        For Each wb As WebBrowser In Me.TabControl1.SelectedTab.Controls
            CurrBrowser = wb
            Exit For
        Next

    End Sub
End Class
2. What do you mean, like password saving? You may do a encrypted listbox or so =/.

3. Background of the page itself or the webbrowser...

4. Use My.Settings...make a new string..i.e. homepage

when saving the settings...

Code:
My.settings.homepage = textbox1.text
my.settings.save
my.settings.reload
on form_load

Code:
webbrowser1.navigate(my.settings.homepage)
5. Favourites/History etc.


I mean like saving a webpage to your desktop like with other browsers.

Backround of the webbrowser. Thanks! Thanked
Dim webClient As New System.Net.WebClient
webClient.DownloadFile(webbrowser1.url.absoluteuri , "C:\" & webbrowser1.documenttitle &html")
Posts 1–8 of 8 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

Need help?