Getting A Form To Read HTML Files

I would like to know what code to enter into a button to make it read a .html or .htm, and display its contents in the form, thanks.

Answer this question

Getting A Form To Read HTML Files

  • Giuseppe Porcelli

     

    I used Vb8 too and the code worked fine here.

    Interesting that........



  • Nathan Scott

    Well I had to chop that code down a bit to get rid of about 12 Errors, and once I did it didn't help a bit.

  • flaviocunha

    Public Class Form1< xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

     

        Friend WithEvents WB As New WebBrowser

     

        Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

     

            Me.Controls.Add(WB)

            WB.Location = New Point(20, 20)

            WB.Size = New Size(250, 175)

            WB.ScrollBarsEnabled = True

     

        End Sub

     

        Private Sub cbGo_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cbGo.Click

     

            'you may want to use an openfile dialogue box here

     

            WB.Navigate("H:\wwwRADFEMroot\index.htm")

     

        End Sub

     

     

        End Class

     



  • cisellis

     

    Funny it executed verbatim here and there were no errors.

    What version of VB are you running

    I hope you understood that the ffilespec was an example.



  • Reema6764

    I figured it out on my own sorry for the inconvenience. But I use VB8 (The Latest), and the code didn't work well at all.

  • Getting A Form To Read HTML Files