WebBrowser控件调整大小 [英] WebBrowser control resize

查看:504
本文介绍了WebBrowser控件调整大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在形式的web浏览器访问一个网站,太宽的控制。我想知道是否有一种方法可以调整大小以适应网站的控制。它似乎很简单,但我还没有找到一种方法呢。我知道如何调整控制,我只需要找到该网站的宽度。当你preSS绿色按钮在Safari会自动调整窗口以正确的大小,就像

I have a WebBrowser in my form that accesses a website that is too wide for the control. I would like to know if there is a way to resize the control to fit the website. It seems simple, but i have not found a way yet. I know how to resize the control, I just need to find the width of the website. Just like when you press the green button in safari it automatically resized the window to the correct size.

推荐答案

您应该能够访问web浏览器的文件的大小和它弄的过WebBrowser.Document.Window.Size大小。

You should be able to access the size of the WebBrowser's Document and get it's size through the WebBrowser.Document.Window.Size.

我会使用WebBrowser控件的DocumentCompleted事件要等到页面加载,然后用你的大小调整code来调整WebControl的容器尺寸本身。

I would use the WebBrowser Controls's DocumentCompleted event to wait until the page is loaded then use your resize code to resize the webControl container with this size.

这篇关于WebBrowser控件调整大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆