当主窗体在后台加载时,如何显示SplashScreen? [英] How can I show a SplashScreen while the Main Form loads in the background?

查看:91
本文介绍了当主窗体在后台加载时,如何显示SplashScreen?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只想在主表单完全加载到后台后显示我的启动屏幕.我的主窗体本身需要大约3秒钟的加载时间,因此我想先显示初始屏幕3秒钟,然后再显示主窗体,因为主窗体随后将被完全加载,但它显示的初始屏幕为3秒,然后仍然必须加载主窗体..
如何在后台加载主窗体,然后在完全加载后显示它?谢谢您的帮助! :)

I only want to show my splash screen once the main form has completely loaded in the background. My main form by itself takes like 3 seconds to load, so I would like to display the splash screen for about 3 seconds and then show the main form because the main form will then be fully loaded, but instead it shows the splash screen for 3 seconds and then the main form still has to load anyway..
How can I load the main form in the background and then show it when it is fully loaded? Thanks for the help! :)

推荐答案

我知道了.我将初始屏幕设置为要在项目属性"下加载的主要屏幕,但是当您向下滚动时,有一个特定的框可以选择"SPLASH SCREEN",然后选择我的表单,一切都将按其应有的方式工作.谢谢您的帮助.
I have figured it out. I had my splash screen set as the main for to load under the Project Properties, but when you scroll down, there is a specific box to select the SPLASH SCREEN, I then selected my form, and everything worked exactly how it should. Thanks for the help.


您需要创建一个无模式表单并将其显示在主表单的构造函数中,然后在加载表单时将其隐藏.听起来您正在计时器上显示模态形式.使用Show而不是ShowDialog,这意味着您的表单需要成为成员,然后您可以控制隐藏它的时间,并且表单将同时加载
You need to create a modeless form and show it in the constructor of your main form and then when your form is loaded, hide it. It sounds like you''re showing a modal form on a timer. Use Show instead of ShowDialog, which means your form needs to be a member, then you can control when you hide it, and your form will load in the meantime


这篇关于当主窗体在后台加载时,如何显示SplashScreen?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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