Results 1 to 8 of 8

Thread: Displaying web pages in vb.net forms

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2003
    Posts
    4

    Displaying web pages in vb.net forms

    Hi All,

    Does anyone know if it is possible to display html web pages in vb.net forms.

    I have had a look around and can not find any way to do it. I do not need anything fancy just the ability to display a plain html file with a table in.

    Any ideas??

    Thanks,

    Adam

  2. #2
    PowerPoster SuperSparks's Avatar
    Join Date
    May 2003
    Location
    London, England
    Posts
    265
    You can display web pages in the default browser by using the LinkLabel Control:

    VB Code:
    1. Private Sub Form1_Load(ByVal sender As System.Object, ByVal e _
    2. As System.EventArgs) Handles MyBase.Load
    3.     LinkLabel1.Text = "Click here to get more info."
    4.     LinkLabel1.Links.Add(6, 4, "www.microsoft.com")
    5. End Sub
    6. Private Sub LinkLabel1_LinkClicked(ByVal sender As System.Object, ByVal _
    7. e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles _
    8. LinkLabel1.LinkClicked
    9.     System.Diagnostics.Process.Start(e.Link.LinkData.ToString())
    10. End Sub

    Is that what you were looking for?
    Nick.

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2003
    Posts
    4
    I was wanting to be able to imbed them in the actual form, without having to launch an external browser.

    Like you could in vb6 with the webbrowser control, which seems to be non existant in vb.net.

    Any further ideas?

    Adam

  4. #4
    Lively Member matt3011's Avatar
    Join Date
    May 2002
    Location
    France
    Posts
    82
    Why don't you use the webbrowser from microsoft :
    c:\windows\system32\shdocvw.dll
    You just have to reference it :
    in your toolbar, right click, add/remove components, COM component, and you'll find it.
    I know this is using COM, maybe you're looking for straight .NET code.

  5. #5
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Originally posted by matt3011
    I know this is using COM, maybe you're looking for straight .NET code.
    Unfortunately , there is not .NET way yet .

  6. #6

    Thread Starter
    New Member
    Join Date
    Jul 2003
    Posts
    4
    Hi,

    If I use the SHDOCVW.DLL will there be any problems in using the app on other versions of windows.

    Mainly 2k and XP and possible NT and 2003.

    Can I package the DLL with the app?

    Thanks,

    Adam

  7. #7
    Lively Member matt3011's Avatar
    Join Date
    May 2002
    Location
    France
    Posts
    82
    I don't think that's useful to package it with your app because it is installed by Internet Explorer and so, it is present on every computer running Microsoft OSs.

  8. #8

    Thread Starter
    New Member
    Join Date
    Jul 2003
    Posts
    4
    Well it will make life easier for me, as I can just assume that it will be there then, because as you say, any ms os comes with IE in some form.

    Thanks for your help, I will look into using.

    Do you know if it is possible to pass a string or a stream of html as the web page instead or a file, from some thing like a streamwriter?

    Thanks,

    Adam

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width