Webbrowser control runs so SLOW!

myemptyfilled

Newcomer
Joined
Apr 16, 2003
Messages
6
hi all...i recently started making my own little web browser in VB.net.
i wanted to be able to have a small combo box (with autocomplete) and a go button...this would open another form with the web browser (which open up full screen - 1024x768)control, a back, a forward, and a stop button. I have been able to get it all done. and it acctually works. BUT, just scrolling through a website is like molasses. it runs so slow. i noticed that in the task manager my process would range from 60-90% cpu usage. the ENTIRE time the window is up. now i know there must be somethin wrong with my code, so maybe someone can help me out...here it is...

this is the code that takes the text from the combobox and opens the second form...



Visual Basic:
Private Sub btnGo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGo.Click

        'Begin Autocomplete code...

        Dim x As Integer
        Dim strYesNo As String
        Dim count As Integer

        count = cboAddy.Items.Count

        If count = 0 Then
            cboAddy.Items.Add(cboAddy.Text)
        Else

            strYesNo = "Y"
            For x = 0 To (count - 1)
                If cboAddy.Text = cboAddy.Items.Item(x) Then                    
                    strYesNo = "Y"
                    Exit For
                Else
                    strYesNo = "N"
                End If
            Next
            If strYesNo = "N" Then
                cboAddy.Items.Add(cboAddy.Text)
            End If
        End If

        'End Autocomplete code...

        Dim frmBrowser As New Browser()
        frmBrowser.txtTemp.Text = cboAddy.Text
        frmBrowser.Show()

    End Sub



then here is the code in the second form...


Visual Basic:
Private Sub Browser_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Dim frmAddress As New Address()
        Dim url As String

        FormBorderStyle = FormBorderStyle.None

        url = txtTemp.Text
        Text = url
        webMain.Navigate(url)

    End Sub



i basicaly have it so that when the "Go" button is pressed, it will open the form and load the url at the form load. I'm new to VB and i think i need some better coding procedures...ANY suggestions would be greatly appreiated.

thanks,
dave
 
sometimes its the web site you are viewing... have you tried something little like hotmail.com?

you could try seting the url to "about:blank" and see if the cpu is still being used that much, if so then it would definately be something in your code...

the code you posted, however, looks ok to me...

try looking through the Browser form and see if there is anything there that would run on a regular basis... that might be what is causing the slowness...

if you upload the Browser form then I'll take a look and see if its something in there...
 
UCM said:
sometimes its the web site you are viewing... have you tried something little like hotmail.com?

you could try seting the url to "about:blank" and see if the cpu is still being used that much, if so then it would definately be something in your code...

the code you posted, however, looks ok to me...

try looking through the Browser form and see if there is anything there that would run on a regular basis... that might be what is causing the slowness...

if you upload the Browser form then I'll take a look and see if its something in there...

i have been goin to alot of different pages. little ones big ones...they all seem to scroll real slow.

when about:blank is loaded the cpu is at 0%..so i guess it's not my code. i've attached the browser form to this message. there are a couple items that are behind the browser control (webMain) you could just send webMain to the back to see them. Thanks alot
 

Attachments

I FIXED IT! woohoo...i was looking through all the properties on the form and i saw that i had transparency set to some color. so i clear the property for the transparency and BAM...it works great. :)
 
Back
Top