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...
then here is the code in the second form...
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
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