Results 1 to 4 of 4

Thread: Web browser control : navigating to html

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2006
    Posts
    154

    Web browser control : navigating to html

    I have html source in text box control.
    and i want to display it in webpage form in webbrowser control

    I am doing very simple

    Webbrowser1.Navigate Text1.Text

    but its not displaying me anything.

    I also tried

    WebBrowser1.Navigate "<htm><head></head><body><h1>Hello World</h1></body></html>"

    and its also displaying nothing.

    Kindly help me to display web page like display for html source in text box.

    Thank You.

  2. #2
    VB Guru ganeshmoorthy's Avatar
    Join Date
    Dec 2005
    Location
    Sharjah, United Arab Emirates
    Posts
    3,031

    Re: Web browser control : navigating to html

    I hope WebBrowser1.Navigate and WebBrowser1.Navigate2 will take only the url links as parameters...
    If an answer to your question has been helpful, then please, Rate it!

    Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.


  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Nov 2006
    Posts
    154

    Re: Web browser control : navigating to html

    I think its the reason i am seeing blank document.

    btw in VB.Net it can done with DocumentText property.

    MyWebBrowser.DocumentText = "<html></html>"

    but i want to it in vb6.

  4. #4
    PowerPoster lintz's Avatar
    Join Date
    Mar 2003
    Location
    The 19th Hole
    Posts
    2,697

    Re: Web browser control : navigating to html

    One option is to create a temp html file then open it in the webbrowser.

    VB Code:
    1. Sub Command1_Click()
    2.  
    3. 'create temp file
    4. Open App.Path & "\temp.html" For Output As #1
    5. Print #1, Text1.Text
    6. Close #1
    7.  
    8. 'Now display in webbroswer
    9. Webbrowser1.Navigate App.Path & "\temp.html"
    10.  
    11. End Sub

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