English 中文(简体)
C# Webbrowser Control - Defining documentloaded
原标题:C# Webbrowser control - Defining document loaded

文件 完成后,将完成所有装载量(磨损、闪电等)的内容。 我正在等待下载所有要点以完成这份文件。 我如何界定什么时候(网页)装满(当客户看到网页时)? 是否有任何活动来界定联络处向客户提供什么?

问题回答

为什么不要让这个网页引起一场事件? 例如:

using System.Runtime.InteropServices;
using System.Windows.Forms;

namespace TestWebBrowser
{
    [ComVisible(true)]
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, System.EventArgs e)
        {
              webBrowser1.ObjectForScripting = this;
              webBrowser1.DocumentText = @"
                    <html>
                    <body onLoad= jscript:window.external.DocumentLoaded(); >
<img src=""http://www.nasa.gov/images/content/464377main_image_1695_1600-1200.jpg"" />
</body>
</html>";
        }

        public void DocumentLoaded()
        {
            MessageBox.Show("Document Finished Loading.");
        }
    }
}

在上述样本中,该网页使用Load()活动,在网页完成装货时通知表格。

希望这一帮助。





相关问题
Destroying session on close of the browser from the task bar

When I close the browser window from the task bar the session is not getting destroyed. I could handle this on closing the browser using close(X) button or by pressing Alt+F4 using javascript. But ...

InvokeMethod not working on windows form

I have a windows form containing a webbrowser that navigates to a site which sends data back in the form of a table. I would like to transfer the data on that table to a application that runs some ...

Automated web browser?

For learning purposes I would like to automate some parts in a browser game, currently I am trying to fill out some simple text boxes, without any luck though. I ve created a WebBrowser component on ...

MySQL - Username to connect using Query browser

I m fairly new to my sql, and I need to know what is the default username for mysql, like in mssql you have sa . I can connect to the mysql command client but it does not ask me for a username.

Widescreen check on normal screen

I work normal screen and I develop some web application. When the application goes on widescreen some of the pages looks weired. Is there any way I can view my web page as it looks in Widescreen on my ...

How does Google get a toolbar right below the tabs in IE?

I researched through all BHO related documentation, but I just can t figure how Google gets the translation toolbar right below the tabs in IE. Any useful pointers how to achieve the same effect for ...

How to detect page zoom level in all modern browsers?

How can I detect the page zoom level in all modern browsers? While this thread tells how to do it in IE7 and IE8, I can t find a good cross-browser solution. Firefox stores the page zoom level for ...

热门标签