Raditya Kurnianto
Raditya Kurnianto

Reputation: 744

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.

Upvotes: 0

Views: 148

Answers (2)

Teppic
Teppic

Reputation: 2546

Visual Basic has support for splash screens that you can take advantage of by referencing Microsoft.VisualBasic in your c# project.

An example can be found at Splash screen doesn't hide - using Microsoft.VisualBasic library

Upvotes: 1

abc
abc

Reputation: 2437

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();
    }
}

Upvotes: 2

Related Questions