nice work & gud going guyz
Printable View
nice work & gud going guyz
Would be nice if you also explained how to submit forms and stuff, since sometimes it's just easier doing it with the WebBrowser control.
Hey man.Quote:
Originally Posted by MSWindowsUser
I have been making my web browser, and it rocks!!
but i downloaded yours, and was interested to see the "File, Tools, Internet Options"
This looks like a hugely useful tool, but i cant make it work!!!
What code did you use to open the Internet Options please??
Thanks man!
Here is the code i am using just now for my Internet Options button
It doesnt work :(
can you help plz?
vb Code:
Private Sub IOptions_Click() Shell ("Control Panel/Internet Options") End Sub
Never mind, Hack helped me
if anyone is interested, the code to launch internet options is...
vb Code:
Private Sub IOptions_Click() Shell "C:\Windows\System32\control.exe" & " Inetcpl.cpl", 1 End Sub
Is there a way to encrypt URLs you enter into the combobox?
That is not an acceptable question to ask on this site.
Assisting in violating your schools rules or security systems (no matter how justified you think it is) is against our rules - see the Acceptable Use Policy link at the bottom of all VBForums pages.
that was just an example so that people would get what i meant, I'm not going to use it for malicious purposes, that would get me banned from the school computers.
and besides, if I wanted to do that I'd just use a proxy; there are hundreds of them lying around the interwebs.
Is it even possible to encrypt all URLs passing through the browser?
I'm not aware of any valid reason for doing that - only for bypassing security systems (which often block proxies).
As you have not given another reason, I have serious doubts of your intentions, and cannot allow an answer (from anyone) unless you send me a valid reason via Private Message.
Show page title in the forms caption.Code:Private Sub WebBrowser1_TitleChange(ByVal Text As String)
Form1.Caption = WebBrowser1.LocationName
End Sub
why did you post that?!Quote:
Originally Posted by joebobfrank
It's a useful thing for a web browser to show page title... just posting code in the codebank...
Ok here's how to open up the page source in notepad and not keep it stored on your hard drive (so you don't have to manually delete the source code text files)
Code:
Private Sub MenuSource_Click()
Text1.Text = Form1.WebBrowser1.Document.documentElement.innerHTML
Dim hFile As Long
Dim sFilename As String
sFilename = "c:\tempsource.txt"
'obtain the next free file handle from the
'system and and save the text box contents
hFile = FreeFile
Open sFilename For Output As #hFile
Print #hFile, Text1.Text
Close #hFile
Dim strtest As String
Dim FileSystemObject As Object
strtest = "notepad c:\tempsource.txt"
Shell strtest, vbNormalFocus
Kill "c:\tempsource.txt"
End Sub
Another thing to add to the tutorial
Code:Private Sub MenuFind_Click()
WebBrowser1.ExecWB OLECMDID_FIND, OLECMDEXECOPT_DODEFAULT
End Sub
What is the code for the status bar? How do you do it? Sorry I'm noob. :lol:Quote:
Originally Posted by MSWindowsUser
i keep on getting this error
Run-time error '-1 (ffffffff)'
when i put these codes
Private Sub WebBrowser1_NavigateComplete2(ByVal pDisp As Object, URL As Variant)
On Error Resume Next
Dim i As Integer
Dim bFound As Boolean
Me.Caption = WebBrowser1.LocationName
For i = 0 To cboAddress.ListCount - 1
If cboAddress.List(i) = WebBrowser1.LocationURL Then
bFound = True
Exit For
End If
Next i
mbdontnavigatenow = True
If bFound Then
cboAddress.RemoveItem i
End If
cboAddress.AddItem WebBrowser1.LocationURL, 0
cboAddress.ListIndex = 0
mbdontnavigatenow = False
End Sub
what will i do?
doesn't mbdontnavigatenow needs to be declared?
Under Option ExplicitQuote:
Originally Posted by vbnoobie
Type in Private mbdontnavigatenow as Boolean.
That will work. Trust me.
The other codes go below the "Option Explicit" and "Private mbdontnavigatenow as Boolean" linesCode:Option Eplicit
Private mbdontnavigatenow as Boolean
Yeah, im missing basic components in my vb6 app :(
"Microsoft html object library" and "Microsoft internet controls"
Browse to your system directory and add them
Microsoft HTML Object Library ---> mshtml.tbl
Microsoft Internet Controls ------> shdocvw.dll
mshtml.tbl is missing :(Quote:
Originally Posted by jmsrickland
I find mshtml.dll but cant be added anyway :(
getting runtime error '-2(fffffffe)'
Sorry about the misspell: It should be mshtml.tlb not mshtml.tbl
yeah i tried em both :(Quote:
Originally Posted by jmsrickland
You were able to add the DLL, right, but not the mshtml.tlb?
Don't know exactly how you are doing it but the mshtml.tlb should be added to the reference list (not the components list). Is this what you are trying to do with out success?
this is an awesome tutorial thanks!! ^_^
How can I make a Tabbed webbrowser with TabStrips???? I have been looking for this for 2 days!!! Please help me!!!
I mean: When I click CommandButton1, then in tabStrip a second Tab appears with a second Webbrowser (like in IE7, Mozilla, Opera,....)
All I can find on website's Is Tabs for VB.net or VB2008 but NOTHING for VB6!! Please help!!
I am also trying to get a tabbed web browser, but on the moment I have problems with my progressbar. My progressbar doesn't stay on the place I want it to have with my screen maximized. If I resize my screen it replaces perfectly.
If someone could help me with Tabs or my progressbar, I would really appreciate that.
Using the method in the tutorial, how could you display the blocked pop-up? Using Internet Explorer 7, it displays the yellow bar and you have the option of allowing the pop-up, but it refreshes the page in order to do it. I've managed to achieve the same effect, however, is there a way of doing it without refreshing?
I have been looking for a way to open links in new window when a user RIGHT clicks on the menu and selects Open In New Window. This app is the only one I found that opens a new window,,, but there is no Source for VB6...
Can anyone supply the actual example on HOW TO open a a link in new window when user right clicks on the link and selects OPEN IN NEW WINDOW
I have tried to use this tutorial to open up a web page, fill out a form (you put in an IP address and info about that address comes out after submission) and extract the data from the form.
It works in the web browser window, I display the data from the filled out form successfully.
However, after the data is displayed the "WebBrowser1.Document.body.innerHTML" values do not match the displayed information.
Why is this.
Here is my code-
Code:Private Sub Command1_Click()
Dim doc As HTMLDocument
Dim strHTML As String
'go to the altavista (text) search page
WebBrowser1.Navigate "http://www.ip2location.com/free.asp"
'Wait until page is loaded
Do
DoEvents
Loop Until Not WebBrowser1.Busy
'Make doc reference to the document inside the webbrowser control
Set doc = WebBrowser1.Document
'Set field ipaddresses with the value of Text1
SetInputField doc, 0, "ipaddresses", Text1
'Submit the form
doc.Forms(0).submit
'Wait until result are loaded
Do
DoEvents
Loop Until Not WebBrowser1.Busy
'loop till we have some stuff in strHTML
Do
DoEvents
strHTML = WebBrowser1.Document.body.innerHTML
Loop Until (Len(strHTML) > 400)
'
' read in the text into string variable
'
strHTML = WebBrowser1.Document.body.innerHTML
Text2.Text = strHTML
'
'text is not matching the window.
'
What I want to do is put in some ip addresses and "submit" and then extract the results from a string variable. I see in the screen the results but the variable does not match. Using VB6 and IE6
The information that you inserted into a field on the page is only valid for that page. After you submit the Form you sit and wait for the returned responses which will be a new page. The information on one page doesn't mean it is going to be there on another page. Another problem you should recode to have your fields that you want to fill in be done in the _DocumentComplete event and not as the result of a loop being terminated by Loop Until Not WebBrowser1.Busy. I say this because the indicator .Busy can be triggered before the document has actually completed the process but in the _DocumentComplete event you are gauranteed that the process has completed.
Hello VB Forums!
Since this is a Internet Explorer based web browser, the code for the search bar was simple:
All you need is :
-1x Text Box
-1x Button
(and one, pre-existing URL bar)
And the code:
That's it!Code:Private Sub BUTTON_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BUTTON.Click
WebBrowser1.Navigate("http://www.google.com.au/search?hl=en&source=hp&q=" + SEARCHBOX.Text + "&meta=&aq=null&oq=googl")
URLBOX.Text = ("http://www.google.com.au/search?hl=en&source=hp&q=" + SEARCHBOX.Text + "&meta=&aq=null&oq=googl")
End Sub
Have Fun!
First, your code is not for VB6.
Second, that is still not the way to do it because you are using hard-coded string URL to be placed in the textbox
I dont understand- how do I use _DocumentComplete event?
I have seen this code but don't really understand when its called, would you do a loop until Page_Loaded is True (obvoiusly you set it to False before calling)?-
After I submit the form how would I retreive the data?Code:Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
If (pDisp Is WebBrowser1.object) Then
Page_Loaded = True
End If
End Sub
And finally how do I block the popup that results from the submission of the form?
EDIT-- I put a breakpoint into the part that read the data (breakpoint at strHTML = ***). My code works excpet that upon form submission you get a popup and my code reads the popup not the form that I submited. If I run this and close the popup manually when the breakpoint is hit I get the correct data. So I guess the critical thing in addition to correctly figuring out when the pages are done is to figure out how to prevent the popup or to close it before reading in the data. I have read the first page of this thread dealing with popups but it confuses my small brain! help!
Hi All I am new to the broswer and the tutorial is great thanks! - Im using the VBA version which I assume is the same control as VB6. Just a quick issue - Im tying to create a versioning control software for Excel, that uses a web address to access an Excel file. Problem that I have is that when the webbrowser access a specified .xls document it opens the spreadsheet in the broswer itself not requesting the user to download the file. Im still new to the control and cant find how to force the control to download the file rather than just display it in the actual webbrowser, any help would be great!
@ MrDavidThorn: Welcome to the VBForums! :)
New codes (attachments below)
Fixes:
Hyperlink in new window fixed
Popup block fixed
Back & Forward button enable fixed
Status fixed
Unfixed:
None as of now :-D
Enjoy my new project. Feel free to rename the objects/program name if desired, and to fix the version number, go to: Project > Project1 Properties...
Make tab, type in a desired number (Integers only), click OK, save every form project, and the project, make an EXE, make an installation project from Start > Programs (All Programs for others) > Microsoft Visual Studio 6.0 > Microsoft Visual Studio 6.0 Tools > Package & Deployment Wizard
Follow the instructions, burn the files to a CD, install the program on other machines.
Next project might contain the Full Screen option & Windows Updates (Windows 95 & Higher only)
edit: to go onto the last visited site, remove the "Visited: Username@" line from the Text box, and click Go, but select the "Visited History" from the drop-down menu, click Get Cache, and select the site that you visited last. :)
Thanks for the cool tutorial I am learning a lot form it to make my own little browser thanks agian. keep up the good work
Hy guys I had a problem with that code in webbrowser tutorial
I need use a webbrowser with one single window. Then I used the example
"Open in new window
VB Code:
'This to open a new window with our browser.Private Sub WebBrowser1_NewWindow2(ppDisp As Object, Cancel As Boolean)Dim frm As Form1Set frm = New Form1Set ppDisp = frm.WebBrowser1.Objectfrm.ShowEnd Sub "
However if i click on link that open in other window the browser show a blank page. It cant open any link with new page
Can someone help me?
I am a bit confused on the progress bar,
When it says: If progress = -1 then progressbar1.value =...
What is Progress refering to?
Very useful. Thank all.
Hi,
how can I make Tabs in this web browser??