C# webbrowser visual basic 2010中的空间

C# webbrowser visual basic 2010中的空间,c#,vb.net,iframe,C#,Vb.net,Iframe,我在应用程序中添加了这些 WebbRowser1 钮扣 文本框 问题是,当我的应用程序加载时,它会从文本框加载iframe并显示在我的网络浏览器上,但它会在我的网络浏览器上显示空白 这是我的密码 Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load WebBrowser1.Docum

我在应用程序中添加了这些

  • WebbRowser1
  • 钮扣
  • 文本框
  • 问题是,当我的应用程序加载时,它会从文本框加载iframe并显示在我的网络浏览器上,但它会在我的网络浏览器上显示空白

    这是我的密码

    Public Class Form1
    
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            WebBrowser1.DocumentText = TextBox1.Text
        End Sub
    End Class
    
    这里显示了iframe和webbrowser之间的空间

    尝试以下方法,使用以下方法。在这里,我们将正文上的边距和填充设置为0。我通过将下面的html添加到项目资源中来测试这一点

    <!DOCTYPE html>
    <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="" X-UA-Compatible"" content="" IE="10" />
        <meta charset="utf-8" />
        <title></title>
    </head>
    <body style="margin:0; padding:0">
        <iframe src="http://www.w3schools.com"></iframe>
    </body>
    </html>
    
    Public Class Form1
        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            WebBrowser1.DocumentText = My.Resources.Contents
        End Sub
    End Class