private void button2_Click(object sender, EventArgs e) { SoundPlayer splayer = new SoundPlayer(@"c:\Users\Mish\Desktop\logoff.wav"); splayer.Play(); this.Hide(); MainScreen obj = new MainScreen(); obj.ShowDialog(); this.Close(); }
private void timer2_Tick(object sender, EventArgs e) { initialPercentage += LoadingSpeed; float percentage = initialPercentage / pictureBox2.Height * 2; label1.Text = (int)percentage + " %"; panel2.Location = new Point(panel2.Location.X, panel2.Location.Y + LoadingSpeed); if (panel2.Location.Y > pictureBox2.Location.Y + pictureBox2.Height) { label1.Text = "2 %"; this.timer2.Stop(); Hide(); MainScreen win = new MainScreen(); win.ShowDialog(); Close(); } }