Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Load a webpage in in visual basic form

Status
Not open for further replies.

haxan

Technical User
Oct 8, 2005
16
NL
Hi all i am using visual studio 2003 and trying to make an visual basic .exe application that loads a webpage from within the vb form when it gets executed . I dragged Microsft Web browser control to form. I just need help with the code that loads a webpage for example cnn.Here is my on onload sub :


Code:
 Private Sub webBrowser_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
       
.........??????


    End Sub

Furthermore,since i want my applicaton work in all computers without them installing any framework, is this method( usng Microsoft Web Browser control) of loading webpage is good for such purpuse ?Thanks
 
Trya having a look at the Navigate method.

i want my applicaton work in all computers without them installing any framework
You want to create an application using the .NET framework but you want it to run on computers that don't have this framework?


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Use the: .Navigate("???")
Where "???" is:
- local file: "file:///c:/somepage.??"
- a url: "
 
ca8msm i am using visual studio 2003 do u think it is possible to make such vb application with out using .net framwork ? If the answer is yes then how ?

Well the method that i am following i want the output to work in all computers that have no dot net frame work or need them to install any file ect.. . Tipgiver well i want to load a URL not a local file.Thanks
 
You can use VS.NET 2003 to write C++ apps which don't require the framework. But any VB.NET or C# (J#, etc) projects require the .net framework runtime to be installed.

While it is quite a large download, the latest figures I've seen from Microsoft are that 55% of the Windows machines connecting to Microsoft.com have it installed. So the penetration is getting pretty good.

If not, you can either:
1) Run dotnetfx.exe as part of your set up (don't bother with the merge modules, they're a pain)
2) Point them to Windows Update (FYI: both .net v2.0 and v1.1 are available)
3) Point them to the Microsoft MSDN website
4) Include dotnetfx.exe on your CD-ROM, and have them run it prior to running your setup.
5) Spend several thousand dollars and buy the Remotesoft linker.

Chip H.


____________________________________________________________________
Donate to Katrina relief:
If you want to get the best response to a question, please read FAQ222-2244 first
 
chiph thank you for your nice reply. Well first thing i need help with how to use Navigate to laod a webpage for example . I could not find it yet!!

i read all the options but it is strange that there is no way to include dot net frame work with my application.exe file so the user do not have to install any thing and on one click the webpage get loaded or going trough any setup!50 percent is very load rate!!

I have visual basic 4 in my mechin could any one tell me how to achive this task using VB 4 instead?thanks
 
haxan, re-read Tipgiver's reply. I think you will find that it shows you what you need with regard to loading the web page.

Hope this helps.

[vampire][bat]
 
I tried what Tipgiver told me but i get the following errors:

Code:
Public Class webBrowser
    Inherits System.Windows.Forms.Form

Private Sub webBrowser_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
       [b] .Navigate("[URL unfurl="true"]http://www.cnn.com")[/URL][/b]
    End Sub

   

End Class

errors:
Code:
1)Leading  '.' or 'i' can only appear inside a 'with' statement.

2)'Sub Main' was not found in 'BrowserControle'

I tried this also i got error again !!:

AxWebBrowser1.Navigate ("
and got the following error :

'Sub Main' was not found in 'BrowserControle'

I be happy if u guys help me fix this problem.Thanks
 
On the project menu, select the bottom item (properties for your application). In the dialog box that appears, check the output type and startup object. They need to be Windows Application and the name of your main form (presumably webBrowser) respectively. Then place:

AxWebBrowser1.Navigate ("
in your form load event handler. It should then work.


Hope this helps.




[vampire][bat]
 
Thanks earthandfire for u help.
I tried it now it works but if i take the .exe file out bin folder i get this error !!

error image
VisualBasicError2.jpg


could u help me fix this erro so that my .exe workes out side bin folder and in any other mechine?Thanks
 
Try creating a setup project to install the application on other machines rather than just getting the exe out of the bin folder.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
You will need more than just the .exe.

Either follow ca8msm's advice or copy the .exe AND any .dll files from your bin folder onto the target machine. Make sure you copy all the files into the same folder.


Hope this helps.

[vampire][bat]
 
Thank u all for your replies. ca8msm could u tell me how to make setup project to install the application on other machines ?I be happy if u tell me step by step how to do it.Thanks
 
Try searching google as there are lots of examples and then post back if you have any specific problems with the setup project.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
At the deployment projects there is the setup project and a wizard. These two projects are the same. The second one has some steps. Try this also as a startup; it might help.
Then do what ca8msm suggested.
:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top