简体   繁体   English

创建启动画面而不创建多线程表单

[英]Creating splashscreen without creating multi-threading form

I want to make a splash screen without creating multi-threading on the application does anybody have any idea to create splash screen that will automatically show the next form? 我想创建一个启动画面而不在应用程序上创建多线程,是否有人有想法创建启动画面以自动显示下一个表单?

I have trying this timer_tick and creating object to showdialog for the next form but it doesn't work properly. 我尝试使用这个timer_tick并创建对象以显示下一个表单的对话框,但是它无法正常工作。

Try something like this: 尝试这样的事情:

public partial class FormTicker : Form
{
    Timer timer;
    public FormTicker()
    {
        timer = new Timer();
        InitializeComponent();
        timer.Interval = 2000;
        timer.Tick += new EventHandler(timer_Tick);
        timer.Start();
    }

    void timer_Tick(object sender, EventArgs e)
    {
        timer.Stop();
        FormMain formMain = new FormMain();
        formMain.Show();
        this.Hide();
    }
}

Visual Basic has support for splash screens that you can take advantage of by referencing Microsoft.VisualBasic in your c# project. Visual Basic支持启动屏幕,您可以通过在c#项目中引用Microsoft.VisualBasic来利用它。

An example can be found at Splash screen doesn't hide - using Microsoft.VisualBasic library 可以在未隐藏启动画面的情况下找到一个示例-使用Microsoft.VisualBasic库

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM