Link to home
Start Free TrialLog in
Avatar of ryancrawcour
ryancrawcour

asked on

Using the WebBrowser Control with Visual Basic 6

Hello all,

i would like to implement a browser within my application. i have some online help stuff that i would like displayed similar to the help provided with MSDN. this is simply a browser with control taken over how the browser operates. i would like the same level of control.

what would be the best way to do this ?
does IE need to be installed on the machine before i can use the WebBrowser control ?

any ideas on the best way to accomplish this ?
Avatar of CJ_S
CJ_S
Flag of Netherlands image

Internet Explorer is only a plain wrapper around the webbrowser control. The webbrowser control is the actual control that is able to show the html pages. If you can use the WebBrowser control it does not necessarily mean that IE is installed.

The best way would be the WebBrowser control....:-/...

what exactly are your questions?

regards,
CJ
Avatar of cmgarnett
With a web browser control on your form and

WebBrowser1.Navigate ("www.microsoft.com")

in your form load event, you will see the microsoft page. You can then navigate around using the page's links.
Right clicking on the browser control gives you forwards and backwards control if you want it.

A list box with your help topics in it could be used to provide the URLs and then you can use

WebBrowser1.Navigate(ListItemURL)
Avatar of ryancrawcour
ryancrawcour

ASKER

i have a web application that i would like to run within an environment that i have coimplete control over. ie. i do not want the user to access any of the menu items ot address box etc.

does ie5.5 need to be installed on the machine before i can use this control ? or is there a re-distributable version ?

if it's web application you can try to use javascript or vb script to control ie : something like this :
newwindow=window.open("main.asp?" + lvsquery ,null ,"height=500, width=700, status=no, toolbar=no, titlebar=no, menubar=no, location=no, resizable=yes");

if you want to use vb : start a new project vb, select project and choose add form locate WebBrowser form.

ASKER CERTIFIED SOLUTION
Avatar of CJ_S
CJ_S
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The webbrowser control provides you with fewer facilities than internet explorer.

WebBrowser.AddressBar = False - Stops the address bar from showing

WebBrowser.Navigate("URL") - Goes to a particular page.

WebBrowser.GoBack - Goes back a page.
WebBrowser.GoForward - Goes forwards if possible.

Put the go back and forward methods behind your command buttons and you should be away.
On distributing the webbrowser control - unfortunately according to MS you have to distribute IE in order to distribute this control, and I'd agree that this is safer. They don't really care who distributes it (so it gets on more client PCs) and you can get a license from them very easily if you have a search around their site.
the thing that worries me is that we plan on releasing this application into an evironment where Netscape is the corporate choice for browser software. our application has been written to make use of thing like behaviors etc which Netscape will not support.

previously it has not been an issue because we simply install IE in the environment and then run our application. however at this particular site they want their users to continue using netscape and as their access to netscape and sites is controlled by login scripts etc. they do not want us to release IE which the users can then use freely.

they are quite happy however if we install components that will allow our app to run in a controlled environment.

so what i was planning on doing was to write a simple exe with one form containing a WebBrowser control. when this exe is run it will load our web app and nothing else.

is this possible ?

Unfortunately not - it seems to be an all-or-nothing approach to IE redistribution.
Don't you just love behaviours? Don't you just hate netscrap and client sites which insist on using this terrible browser?
yeah i do hate people that insist on using something that is way behind ... but that is another entirely different debate.

unfortunately this client site is worth a LOT of money to me. and either i recode everything not to use behaviors or i find a way to convince them that IE is the way to go.

however considering the company i very much doubt that they would embrace Microsoft technologies with open arms.
Hi ryancrawcour,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will suggest to:

    Accept CJ_S's comment(s) as an answer.

ryancrawcour, if you think your question was not answered at all or if you need help, you can simply post a new comment here.  Community Support moderators will follow up.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
Comment from expert accepted as answer

Computer101
E-E Moderator