|
-
Aug 13th, 2008, 03:41 AM
#1
Thread Starter
New Member
WebBrowser Problems
Hello All,
I am currently making a WebBrowser in Visual Basic 6 using Microsoft Internet controls. I have a few problems and questions, but first i will show you my code. It is fairly basic.
Code:
Private Sub gobutton_Click()
On Error Resume Next
WebBrowser1.Navigate (urlbar.Text)
End Sub
Private Sub backbutton_Click()
On Error Resume Next
WebBrowser1.GoBack
End Sub
Private Sub forwardbutton_Click()
On Error Resume Next
WebBrowser1.GoForward
End Sub
Private Sub homebutton_Click()
On Error Resume Next
WebBrowser1.gohome
End Sub
Private Sub refreshbutton_click()
On Error Resume Next
WebBrowser1.Refresh
End Sub
Private Sub urlbar_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
WebBrowser1.Navigate (urlbar.Text) 'similar to acceptbutton
End If
End Sub
Private Sub WebBrowser1_ProgressChange(ByVal Progress As Long, ByVal ProgressMax As Long)
On Error Resume Next
If Progress = -1 Then loadbar.Value = 100
loadinfo.Caption = "Done"
If Progress > 0 And ProgressMax > 0 Then
loadbar.Value = Progress * 100 / ProgressMax
loadinfo.Caption = Int(Progress * 100 / ProgressMax) & "%"
End If
Exit Sub
End Sub
Private Sub WebBrowser1_StatusTextChange(ByVal Text As String)
On Error Resume Next
If (InStr(WebBrowser1.LocationURL, "<html>")) <> 0 Then
urlbar.Text = ""
else
urlbar.Text = (WebBrowser1.LocationURL)
end if
End Sub
Private Sub stopbutton_click()
On Error Resume Next
WebBrowser1.Stop
End Sub
Private Sub Form1_Resize()
WebBrowser1.Width = Me.ScaleWidth
End Sub
WebBrowser=Webbrowser1, Text input for url = urlbar (TextBox), I also have a progress bar and label alongside. All other objects are easily identifiable.
MY WebBrowser works well but there are a few slight problems that i am finding difficult to change.
- When i type in the textbox and move my mouse away from it, all content that i have just typed is deleted???
- When i manage to submit the url, the content of the textbox (url) dissapears and only when the page has loaded does it come back. I would like the textbox to always have content.
- Occasionally when i am browsing i encounter problems such as "-1 (ffffffffffff)" and "-2 (fffffffffe)" I have checked my code. How can i fix this?
- Additionally i would like to improve the appearance of my application by changing the user interface, is there a simple way to do this? Do i have to 'Skin'?? Please Help!!
I know this is a long list of questions and problems, sorry if this is slightly overbearing. I just need help!
Greatly Appreciated,
Hardware
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|