Strange Problem, any ideas how this happened?

Hi there, I have an application which basically loops through a large number of URLs and records whether they could be opened or not.

The problem which has occured is that there are a number of controls and frames on the form and to the right of these is a web browser control which is used to open the URLs and so on.  For some reason, during the process of checking a number of URLs the web browser has resized itself to cover the entire form yet remains behind the other controls.  ALthough this isn't what I want to happen in this application, I would like to know how it occured so that I can recreate in aplications where it might be a nice feature.

This screenshot shows what I mean, the white background and web page which is covering the background of the form was originally placed where the red square is.  I have no code which actively resizes the browser control, so presumably some javascript on one of the webpages which was opened has caused this rather strange effect.

Any ideas on how this happened and a) how I could recreate it and b) how I could prevent it happening in this appliction would be great thanks,

Link to screenshot:


Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Guy Hengel [angelIII / a3]Billing EngineerCommented:
As you blanked out the web addresses, I cannot verify myself.
However, I assume that the relevant web sites resize the window when the page is openend, which makes you web control resize as result.
Some web sites will resize the browser window.
I don't know the syntax right off the top of my head, but you
could go to one of the sites that does it and view the source.
Once you know the source, you can strip it out before it gets to the browser.
I would imagine either java script or HTML is resizing it.

<BODY onload="top.moveTo(0,0);top.resizeTo(screen.width-2,screen.height-2);">

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Your Guide to Achieving IT Business Success

The IT Service Excellence Tool Kit has best practices to keep your clients happy and business booming. Inside, you’ll find everything you need to increase client satisfaction and retention, become more competitive, and increase your overall success.

oops.. Add the code above to notpad and save it as : resize.html

Then just to test it navigate to it:
WebBrowser1.Navigate2 "D:\resize.html"
ShelfieldCollegeAuthor Commented:
Cheers thanks, that explains how it's happened, how about a way of preventing it happening with using a simple webbrowser control, as opposed to retrieving the HTML first then removing that code manually before desplaying it?

it's actually quite a nice little effect in an application, especially if I could get the form controls to have a transparent background.

Anyways, if anyone knows how to prevent it happening I'd greatly appreciate it.


The simplest way would be to set the size and position back in the
resize event of the control.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.