Reputation: 43
I have a webBrowser that loads a banner. But this banner is to small to fit in the webbrowser. How can I make this banner bigger? This is how I use the webBrowser in c#:
webBrowserBanner.NavigateToString("<html><head><script language='javascript' src='" + bannerstring + "'></script></head></html>");
Bannerstring contains the banner url. Is it possible to zoom the banner or is it possible that the webBrower height and width can be changed.
Upvotes: 0
Views: 601
Reputation: 2276
After you have the bannerstring
, you can manipulate it and change initial scale.
string bannerstring =bannerstring.Replace("</head>", "<meta name=\"viewport\" content=\"width=device-width; initial-scale=1.0; maximum-scale=2.0;user-scalable=no;\"/><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\" /></head>").Replace("</body>", "<script> document.body.style.zoom = 1.8; window.scrollTo(680,1000) </script></body>");
webBrowserBanner.NavigateToString(bannerstring);
document.body.style.zoom
is used to Zoom the Area which you want
Upvotes: 2