在Windows表单加载包含WebBrowser控件之前显示图像 [英] Display Image before Windows form loads containing a WebBrowser control

查看:75
本文介绍了在Windows表单加载包含WebBrowser控件之前显示图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有一个Windows表单,其中包含一个WebBrowser控件,该控件正导航为例如:www.google.com.

现在,当我启动我的应用程序时,将发生以下事件:
1. Windows窗体加载(空白)
2.几秒钟后,WebBrowser加载预期的页面(在此处www.google.com)

现在我的要求是:
我想在网络浏览器在表单中加载页面之前显示一个图像(例如:正在加载图像).
因此,一旦启动该应用程序,它应该首先显示正在加载图像"和其中包含已加载"网页的表单.

任何人都可以在这里帮助我实现同样的目标.

谢谢,
Rajeev

Hi All,

I have a Windows form which contains a WebBrowser control which is navigating to say for ex: www.google.com.

Now when I launch my application the following event occurs:
1. The windows form loads(blank)
2. after few seconds, the WebBrowser loads the intended page(here www.google.com)

Now my requirement is:
I want to display an Image(say: Loading image) before the webbrowser loads the page in the form.
So as soon as I launch the application, it should first display the Loading Image and the the Form with the Loaded web page inside it.

Can anybody help me here to achieve the same.

thanks,
Rajeev

推荐答案

在开始加载之前将WebBrowser控件隐藏(在设计器中将Visible设置为False),并(为简单起见)在您的窗体上放置一个PictureBox. br/> 处理WebBrowser DocumentCompleted事件.
事件触发时,隐藏您的PictureBox并显示WebBrowser.
Hide the WebBrowser control before you start to load (set Visible to False in the designer), and (for simplicity) put a PictureBox on your form.
Handle the WebBrowser DocumentCompleted event.
When the event fires, hide your PictureBox and display the WebBrowser.


选中 [ ^ ]可能会对您有所帮助.
check this[^] it may help you.


这篇关于在Windows表单加载包含WebBrowser控件之前显示图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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