-2

I am trying to close a winform "Splash Screen" and running another form.

private void timer1_Tick(object sender, EventArgs e)
    {
        rectangleShape2.Width += 5;
        if (rectangleShape2.Width >= 473)
        {
            timer1.Stop();
            HomeScreen H = new HomeScreen();
            H.ShowDialog();
            //to close current form
            this.Close();
        }
    }

The problem is that: the Splash Screen form still working in the task bar
how can i close it and hide it from the task bar?

Thanks.

Nemo
  • 203
  • 3
  • 12

2 Answers2

0

hope this solution will help you

void tmr_Tick(object sender, EventArgs e)

 {

     //after 3 sec stop the timer

     tmr.Stop();

     //display mainform

     Mainform mf = new Mainform();

     mf.Show();

     //hide this form

     this.Hide();

 }

Double-click on the FormClosed Event and add this Code:
private void Mainform_FormClosed(object sender, FormClosedEventArgs e)

{

     //exit application when form is closed

     Application.Exit();

} 
Atul
  • 155
  • 1
  • 1
  • 19
  • 1
    Splash Screen is my startup form ! So it will closed the application from the first time every time – Nemo Jun 02 '18 at 20:25
0

Try To replace

this.Hide()

from

this.Close()

its working for me