private void PassTextBox_KeyDown(object sender, KeyEventArgs e) { switch (e.KeyCode) { case Keys.Up: LabelUserText.Text = String.Empty; e.SuppressKeyPress = true; LabelUserText.Focus(); break; case Keys.Enter: case Keys.Down: if (LabelUserText.Text.Length > 3 && PassTextBox.Text.Length > 3) { e.SuppressKeyPress = true; ButtonSend.Focus(); } else { BackPanelPassText.BackColor = Color.Red; } break; case Keys.Escape: PassTextBox.Text = String.Empty; break; } }
private void AuthFormClassic_Shown(object sender, EventArgs e) { try { if (SaveLastLogin) { LabelUserText.Text = lastLogin; LabelUserText.SelectionStart = LabelUserText.Text.Length; } } catch (Exception exc) { Log.ExcWrite("[AuthFormClassic_Shown]" + exc.Message); } connecting.Hide(); LabelUserText.Focus(); Thread th = new Thread(delegate() { try { Thread.Sleep(100); (Application.OpenForms[1] as AuthFormClassic).BeginInvoke((MethodInvoker)(delegate() { labelB.Visible = true; })); Thread.Sleep(100); (Application.OpenForms[1] as AuthFormClassic).Invoke((MethodInvoker)(delegate() { labelB.ForeColor = Color.Yellow; })); (Application.OpenForms[1] as AuthFormClassic).Invoke((MethodInvoker)(delegate() { labelC.Visible = true; })); Thread.Sleep(100); (Application.OpenForms[1] as AuthFormClassic).Invoke((MethodInvoker)(delegate() { labelC.ForeColor = Color.Yellow; })); (Application.OpenForms[1] as AuthFormClassic).Invoke((MethodInvoker)(delegate() { labelD.Visible = true; })); Thread.Sleep(100); (Application.OpenForms[1] as AuthFormClassic).Invoke((MethodInvoker)(delegate() { labelD.ForeColor = Color.Yellow; })); (Application.OpenForms[1] as AuthFormClassic).Invoke((MethodInvoker)(delegate() { labelE.Visible = true; })); Thread.Sleep(100); (Application.OpenForms[1] as AuthFormClassic).Invoke((MethodInvoker)(delegate() { labelE.ForeColor = Color.Yellow; })); (Application.OpenForms[1] as AuthFormClassic).Invoke((MethodInvoker)(delegate() { labelF.Visible = true; })); Thread.Sleep(100); (Application.OpenForms[1] as AuthFormClassic).Invoke((MethodInvoker)(delegate() { labelF.ForeColor = Color.Yellow; })); (Application.OpenForms[1] as AuthFormClassic).Invoke((MethodInvoker)(delegate() { labelG.Visible = true; })); Thread.Sleep(100); (Application.OpenForms[1] as AuthFormClassic).Invoke((MethodInvoker)(delegate() { labelG.ForeColor = Color.Yellow; })); (Application.OpenForms[1] as AuthFormClassic).Invoke((MethodInvoker)(delegate() { labelI.Visible = true; })); Thread.Sleep(100); (Application.OpenForms[1] as AuthFormClassic).Invoke((MethodInvoker)(delegate() { labelI.ForeColor = Color.Yellow; })); (Application.OpenForms[1] as AuthFormClassic).Invoke((MethodInvoker)(delegate() { labelJ.Visible = true; })); Thread.Sleep(100); (Application.OpenForms[1] as AuthFormClassic).Invoke((MethodInvoker)(delegate() { labelJ.ForeColor = Color.Yellow; })); (Application.OpenForms[1] as AuthFormClassic).Invoke((MethodInvoker)(delegate() { labelK.Visible = true; })); Thread.Sleep(100); (Application.OpenForms[1] as AuthFormClassic).Invoke((MethodInvoker)(delegate() { labelK.ForeColor = Color.Yellow; })); (Application.OpenForms[1] as AuthFormClassic).Invoke((MethodInvoker)(delegate() { labelL.Visible = true; })); Thread.Sleep(100); (Application.OpenForms[1] as AuthFormClassic).Invoke((MethodInvoker)(delegate() { labelL.ForeColor = Color.Yellow; })); Thread.Sleep(100); (Application.OpenForms[1] as AuthFormClassic).Invoke((MethodInvoker)(delegate() { LabelAction.Visible = true; })); Thread.Sleep(150); (Application.OpenForms[1] as AuthFormClassic).Invoke((MethodInvoker)(delegate() { LabelAction.Visible = false; })); Thread.Sleep(170); (Application.OpenForms[1] as AuthFormClassic).Invoke((MethodInvoker)(delegate() { LabelAction.ForeColor = Color.LightYellow; })); (Application.OpenForms[1] as AuthFormClassic).Invoke((MethodInvoker)(delegate() { LabelAction.Visible = true; })); Thread.Sleep(150); (Application.OpenForms[1] as AuthFormClassic).Invoke((MethodInvoker)(delegate() { LabelAction.Visible = false; })); Thread.Sleep(100); (Application.OpenForms[1] as AuthFormClassic).Invoke((MethodInvoker)(delegate() { LabelAction.ForeColor = Color.Yellow; })); (Application.OpenForms[1] as AuthFormClassic).Invoke((MethodInvoker)(delegate() { LabelAction.Visible = true; })); } catch (Exception exc) { Console.WriteLine(exc.Message); } finally { //Визуальный эффект(ожидание проверки версии приложения) VisualEffect(); } });; th.Name = "Visual AutoForm"; th.Start(); }