public LoginForm() { InitializeComponent(); if (Properties.Settings.Default.StayLoggedIn == true) { CheckBox_StayLoggedIn.Checked = true; } else { CheckBox_StayLoggedIn.Checked = false; } SplashPage1 = new SplashForm(1); SplashPage2 = new SplashForm(2); SplashPage3 = new SplashForm(3); SplashPage4 = new SplashForm(4); loginPanel = new LoginPanel(SplashPage1, SplashPage2, SplashPage3, SplashPage4); loginPanel.Location = new Point(Left + (Width / 2), Top - 20); loginPanel.Owner = this; loginPanelBackTop = new LoginPanelBack(loginPanel, "top"); loginPanelBackTop.Location = new Point(Left + ((Width / 2) - 20), Top - 20); loginPanelBackTop.Owner = this; loginPanelBackBottom = new LoginPanelBack(loginPanel, "bottom"); loginPanelBackBottom.Location = new Point(Left + ((Width / 2) - 20), Bottom); loginPanelBackBottom.Owner = this; SplashPage1.Location = new Point(loginPanel.Left + 41, loginPanel.Top + 137); SplashPage1.Owner = loginPanel; SplashPage2.Location = new Point(loginPanel.Left + 41, loginPanel.Top + 137); SplashPage2.Owner = loginPanel; SplashPage3.Location = new Point(loginPanel.Left + 41, loginPanel.Top + 137); SplashPage3.Owner = loginPanel; SplashPage4.Location = new Point(loginPanel.Left + 41, loginPanel.Top + 137); SplashPage4.Owner = loginPanel; SplashPage1.Opacity = 1; loginPanelBackTop.Show(); loginPanelBackBottom.Show(); loginPanel.Show(); loginPanel.BringToFront(); SplashPage1.Show(); SplashPage2.Show(); SplashPage3.Show(); SplashPage4.Show(); }
private void ActivatePage1() { double o1 = page1.Opacity; double o2 = page2.Opacity; double o3 = page3.Opacity; double o4 = page4.Opacity; if (page2.Visible) { while (page2.Opacity != 0) { o2 -= splashTransitionRate; page2.Opacity = o2; } page2.Hide(); } else if (page3.Visible) { while (page3.Opacity != 0) { o3 -= splashTransitionRate; page3.Opacity = o3; } page3.Hide(); } else if (page4.Visible) { while (page4.Opacity != 0) { o4 -= splashTransitionRate; page4.Opacity = o4; } page4.Hide(); } page1.Show(); while (page1.Opacity != 1) { o1 += splashTransitionRate; page1.Opacity = o1; } }