private void button1_Click(object sender, EventArgs e)
        {
            //frm_english_practice eng_prac = new frm_english_practice();
            //eng_prac.Show();
            //frm_marathi_practice mar_prac = new frm_marathi_practice();
            //mar_prac.Show();
            if (lbx_chapter.SelectedIndex == -1)
            {
                my_messagebox m = new my_messagebox("Select Chapter");
                m.ShowDialog();

                //MessageBox.Show("Select Chapter");
                lbx_chapter.Focus();
                goto abc;
            }
            Globle_data.chapter = lbx_chapter.Text;
            if (optenglish.Checked == true)
            {
                frm_english_practice eng_prac = new frm_english_practice();
                eng_prac.Show();
            }
            if (opthindi.Checked == true)
            {
                frm_hindi_practice hindi_prac = new frm_hindi_practice();
                hindi_prac.Show();
            }
            if (optmarathi.Checked == true)
            {
                frm_marathi_practice mar_prac = new frm_marathi_practice();
                mar_prac.Show();
            }

            abc :;
        }
        private void btn_logout_Click(object sender, EventArgs e)
        {
            panel4.Hide();
            timer1.Enabled = false;
            my_messagebox msg = new my_messagebox("Session Completed! Click ok to see result");

            msg.ShowDialog();
            timer1.Enabled = false;

            this.Hide();
            code_on_close();
            this.Dispose();
            // frm_english_practice_FormClosed(sender, e);

            /*String logout_hour = DateTime.Now.Hour.ToString();
             * String logout_munite = Convert.ToString(DateTime.Now.Minute);
             *
             * String number_of_Error = "0";
             *
             * conn = new SQLiteConnection("Data Source=typing_database.db;Version=3;New=True;Compress=True;");
             * conn.Open();
             * cmd = conn.CreateCommand();
             * String sql = "insert into Student_login values('" + user_name + "','" + student_full_name + "','" + day_ + "','" + month_ + "','" + year_ + "','" + login_hour + "','" + login_munite + "','" + logout_hour + "','" + logout_munite + "','" + language_ + "','" + speed + "','" + number_of_Error + "')";
             * cmd.CommandText = sql;
             * cmd.ExecuteNonQuery();
             * conn.Close();
             */
        }
        private void btn_logout_Click(object sender, EventArgs e)
        {
            //frm_main_login frm_main = new frm_main_login();
            //frm_main.Show();
            //this.Hide();
            timer1.Enabled = false;
            my_messagebox msg = new my_messagebox("Session Completed! Click ok to see result");

            msg.ShowDialog();
            timer1.Enabled = false;
            this.Hide();
            code_on_close();
            this.Dispose();
        }
        private void btn_start_practice_session_Click(object sender, EventArgs e)
        {
            if (lbx_chapter.SelectedIndex == -1)
            {
                my_messagebox m = new my_messagebox("Select Chapter");
                m.ShowDialog();
                //MessageBox.Show("Select Chapter");
                lbx_chapter.Focus();
                goto abc;
            }
            Globle_data.chapter = lbx_chapter.Text;

            if (opt30.Checked == true)
            {
                Globle_data.speed = "30";
            }
            if (opt40.Checked == true)
            {
                Globle_data.speed = "40";
            }



            if (optenglish.Checked == true)
            {
                Globle_data.language = "English";
                frm_english_practice eng_prac = new frm_english_practice();
                eng_prac.Show();
                this.Hide();
            }
            if (opthindi.Checked == true)
            {
                Globle_data.language = "Hindi";
                frm_hindi_practice hindi_prac = new frm_hindi_practice();
                hindi_prac.Show();
                this.Hide();
            }
            if (optmarathi.Checked == true)
            {
                Globle_data.language = "Marathi";
                frm_marathi_practice mar_prac = new frm_marathi_practice();
                mar_prac.Show();
                this.Hide();
            }

            abc :;
        }
        private void timer1_Tick(object sender, EventArgs e)
        {
            ts          = ts - 1;
            lblmin.Text = Convert.ToString(ts / 60);
            lblsec.Text = Convert.ToString(ts % 60);
            if (ts == 0)
            {
                timer1.Enabled = false;
                rt2.Enabled    = false;
                my_messagebox m = new my_messagebox("Time Up!");
                m.ShowDialog();

                //MessageBox.Show("Time Up!");

                this.Hide();
            }
        }
 private void rt2_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar != 8)
     {
         try
         {
             do_work(sender, e);
         }
         catch (Exception ex)
         {
             timer1.Enabled = false;
             rt2.Enabled    = false;
             EndTime        = DateTime.Now.ToLocalTime();
             my_messagebox msg = new my_messagebox("Session Completed! Click Logout to see result");
             msg.ShowDialog();
             timer1.Enabled = false;
         }
     }
 }