private void bgWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            if (result)
            {
                MessageBox.Show("Success");

                textBox1.ForeColor = SystemColors.GrayText;
                textBox1.Text      = "Username";

                textBox2.ForeColor = SystemColors.GrayText;
                textBox2.Text      = "Old password";

                textBox3.ForeColor = SystemColors.GrayText;
                textBox3.Text      = "New password";

                SlidePanel.Show();
                SlidePanel2.Hide();
                SlidePanel3.Hide();
                panel4.BackColor = Color.Gainsboro;
                panel6.BackColor = Color.WhiteSmoke;
                panel2.BackColor = Color.WhiteSmoke;

                lblStatus.ForeColor = Color.Green;
                lblStatus.Visible   = true;
                lblStatus.Text      = "Done";
            }
            else
            {
                MessageBox.Show("Could not update your password");

                textBox1.ForeColor = SystemColors.GrayText;
                textBox1.Text      = "Username";

                textBox2.ForeColor = SystemColors.GrayText;
                textBox2.Text      = "Old password";

                textBox3.ForeColor = SystemColors.GrayText;
                textBox3.Text      = "New password";

                SlidePanel.Show();
                SlidePanel2.Hide();
                SlidePanel3.Hide();
                panel4.BackColor = Color.Gainsboro;
                panel6.BackColor = Color.WhiteSmoke;
                panel2.BackColor = Color.WhiteSmoke;

                lblStatus.ForeColor = Color.Red;
                lblStatus.Visible   = true;
                lblStatus.Text      = "Error";
            }
        }
Beispiel #2
0
        private void textBox1_Enter(object sender, EventArgs e)
        {
            SlidePanel2.Hide();
            panel5.BackColor = Color.WhiteSmoke;

            panel2.BackColor = Color.Gainsboro;
            SlidePanel.Show();

            textBox1.Clear();
            textBox1.ForeColor = SystemColors.WindowText;
            if (String.IsNullOrEmpty(textBox2.Text))
            {
                textBox2.ForeColor = SystemColors.GrayText;
                textBox2.Text      = "Password";
            }
        }
        private void BgWorker_Finished(object s, RunWorkerCompletedEventArgs e)
        {
            //MessageBox.Show("mail Send");
            if (mailStatus)
            {
                MessageBox.Show("E-mail with your password has been sent");
                textBox1.ForeColor = SystemColors.GrayText;
                textBox1.Text      = "E-mail";

                textBox2.ForeColor = SystemColors.GrayText;
                textBox2.Text      = "Username";

                SlidePanel.Show();
                SlidePanel2.Hide();

                panel4.BackColor = Color.Gainsboro;
                panel6.BackColor = Color.WhiteSmoke;


                lblStatus.ForeColor = Color.Green;
                lblStatus.Visible   = true;
                lblStatus.Text      = "Mail sent";
            }
            else
            {
                MessageBox.Show("Something went wrong while recovering the password");
                textBox1.ForeColor = SystemColors.GrayText;
                textBox1.Text      = "E-mail";

                textBox2.ForeColor = SystemColors.GrayText;
                textBox2.Text      = "Username";

                SlidePanel.Show();
                SlidePanel2.Hide();

                panel4.BackColor = Color.Gainsboro;
                panel6.BackColor = Color.WhiteSmoke;

                lblStatus.ForeColor = Color.Red;
                lblStatus.Visible   = true;
                lblStatus.Text      = "Error";
            }
        }