Results 1 to 9 of 9

Thread: WebBrowser Control Problem

Hybrid View

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2010
    Posts
    6

    WebBrowser Control Problem

    Hi Everyone,

    I added a Webbrowser Control to my program and going to the following page "http://217.150.114.84/newsite/mainpage.aspx" using the following syntax

    WebBrowser1.Navigate2 "http://217.150.114.84/newsite/mainpage.aspx", 0, 0, "", ""

    My problem is that if I borwse the page in a normal internet browser the title "Innovating Payment Technology" in displayed ok but when I display the page in my vb6 program the title does not show properly (last part of it is missing). This happens in other pages of the same website.

    Anyone has any idea what I am missing. I think it is the style.css but I am not sure how that works out.

    10x
    Ivan

  2. #2

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2010
    Posts
    6

    Re: WebBrowser Control Problem

    My problem is not the title of the form but the way the webpage is displayed on the screen. As shown in the attached image
    Attached Images Attached Images  

  4. #4
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: WebBrowser Control Problem

    I think it is due to the CSS styling... and IE is having issues on CSS styles... !

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  5. #5
    PowerPoster
    Join Date
    May 2006
    Location
    Location, location!
    Posts
    2,673

    Re: WebBrowser Control Problem

    Ah...then the news is not good...it's to do with the webbrowser itself rather than anything you can do...try viewing the same page in Internet Explorer on your PC and see if it displays properly. There's a chance it will as the webbrowser you're using and the IE you have are different versions, but if you haven't updated IE then you'll probably find it'll be the same in IE as in your webbrowser.

    I get the feeling it's something to do with how the webbrowser control does the displaying of classes when drawing the page.

    Edit: I'd have got there before Akh if I hadn't taken a look at the source for that page before replying :-P
    Well, everyone else has been doing it :-)
    Loading a file into memory QUICKLY - Using SendKeys - HyperLabel - A highly customisable label replacement - Using resource files/DLLs with VB - Adding GZip to your projects
    Expect more to come in future
    If I have helped you, RATE ME! :-)

    I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!

    And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.

  6. #6

    Thread Starter
    New Member
    Join Date
    Jan 2010
    Posts
    6

    Re: WebBrowser Control Problem

    So is there a way to change the version of IE used in VB6 cause in my normal browser the page display correctly. I made sure my components use the same dlls like IE8 but I'm still having the same problem

  7. #7
    PowerPoster
    Join Date
    May 2006
    Location
    Location, location!
    Posts
    2,673

    Re: WebBrowser Control Problem

    If it displays fine in IE8 it should display fine in the webbrowser, but if your "normal browser" isn't IE you shouldn't make the comparison :-)

    A simple fix as I'm assuming you are ONLY using this site with it...when navigation is complete, manually edit out the stylesheet information and have it displayed how you want it...few people know that you can actually write to document.body.innerhtml with webbrowser, most think it's a one-way street, but you can get the HTML and edit it then replace it back. It *ISN'T* the perfect solution, but it's a possible way to sort it out and you don't want to know how much work the alternatives would be, although I am sure someone will surprise me and point out one I didn't know about :-)
    Well, everyone else has been doing it :-)
    Loading a file into memory QUICKLY - Using SendKeys - HyperLabel - A highly customisable label replacement - Using resource files/DLLs with VB - Adding GZip to your projects
    Expect more to come in future
    If I have helped you, RATE ME! :-)

    I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!

    And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.

  8. #8

    Thread Starter
    New Member
    Join Date
    Jan 2010
    Posts
    6

    Re: WebBrowser Control Problem

    My "Normal" Browser is IE8 but in a vb6 WebControl it still doesn't display well. Can you give me a small example to how to edit the style sheet after the page is loaded just to have a starting point

    10x
    Ivan

  9. #9
    PowerPoster
    Join Date
    May 2006
    Location
    Location, location!
    Posts
    2,673

    Re: WebBrowser Control Problem

    Not having used webbrowser in a while, and almost never used it for writing to the browser window, I can't be much help to you and I would have pointed you to a tutorial by Static (a poster here) if it was still online, but sadly it isn't.

    BASICALLY though, you need to wait for webbrowser.busy = false (or checking status, or both, I've mentioned to other people here before that both the functions can return what some might consider false-positives with regards to whether the webbrowser is actually complete or not) then you need to get the HTML into a string and parse the data how you want and put the HTML back into the webbrowser...I'm sure other people would be more knowledgeable than me in the code required, I've always switched to using winsock for my web browsing, but you DON'T want to get into that just for what you require, it is definitely a solution and it'd do everything you want and a hell of a lot more, but the amount of programming you'd need to do would be huge compared to what you need to do at the moment :-)
    Well, everyone else has been doing it :-)
    Loading a file into memory QUICKLY - Using SendKeys - HyperLabel - A highly customisable label replacement - Using resource files/DLLs with VB - Adding GZip to your projects
    Expect more to come in future
    If I have helped you, RATE ME! :-)

    I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!

    And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.

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