网页无法调整到webbrowser控件

时间:2014-11-11 10:05:16

标签: vb.net webbrowser-control

[不重要] 我们有2个网页,在双显示器计算机上显示我们的网络基础设施,固定大小为1920 x 1080.问题是我们必须手动移动显示页面的浏览器,以便将它们放在正确的屏幕上我们的显示器在晚上关闭后的早晨。 [/不重要]

为了避免这种麻烦,我考虑制作一个带有2个表单和浏览器控件的vb.net应用程序,并在程序运行时(重启后)让表单在2个不同的屏幕上打开。但是,这样可以在浏览器控件中正确显示页面。这就像它们被放大了,而它们在Firefox中看起来很正常,已经最大化了(f11)​​。

我希望有人能指出我如何解决这个问题的正确方向。

正如你所看到的,我尝试了一些我自己的事情,但它仍然无效。

Public Class Left

Private Sub Left_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    'Me.Location = New Point(Screen.AllScreens(0).Bounds.X, Screen.AllScreens(0).Bounds.Y)
    Me.FormBorderStyle = Windows.Forms.FormBorderStyle.None
    Me.WindowState = FormWindowState.Maximized
    Me.TopMost = True

    'WebBrowser1.Visible = True

    WebBrowser1.Navigate("http://detectmybrowser.com/") 'Just an example


    'WebBrowser1.AllowNavigation = False

    'WebBrowser1.Document.Body.Style = String.Format("zoom: {0}%", 50)
    TopRight.Show()
End Sub

Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs)
    TopRight.Show()
End Sub
End Class

感谢你们给我的任何帮助。 :)

1 个答案:

答案 0 :(得分:0)

这已经解决了。我使用了其他浏览器控件awesomium,它支持缩放选项。 然后我将新控件添加到表单中并输入:

Public Class Left

Private Sub Left_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    Me.Location = New Point(Screen.AllScreens(0).Bounds.X, Screen.AllScreens(0).Bounds.Y)
    Me.FormBorderStyle = Windows.Forms.FormBorderStyle.None
    Me.WindowState = FormWindowState.Maximized
    Me.TopMost = True

End Sub

Private Sub Awesomium_Windows_Forms_WebControl_LoadingFrameComplete(ByVal sender As System.Object, ByVal e As Awesomium.Core.FrameEventArgs) Handles WebControl2.LoadingFrameComplete
    WebControl2.Zoom = "80"
    TopRight.Show()
End Sub
End Class
相关问题