Example #1
0
        private void Frm_Typing_Load(object sender, EventArgs e)
        {
            // Start the BackgroundWorker.
            backgroundWorker1.RunWorkerAsync();

            //finished = false;
            aTimer.Tick    += ATimer_Tick;
            aTimer.Interval = 3000;
            // danh cho check van ban
            //richTextBox1.Select(0,1);
            //richTextBox1.SelectionColor = Color.Green;
            //richTextBox1.Select(1, 3);
            //richTextBox1.SelectionColor = Color.Red;
            //RandomString();

            if (finished == true && PositionKey != 0)
            {
                PositionKey--;
            }

            int iAscii = RTB_String.Text[PositionKey];

            RTB_String.Select(0, PositionKey);
            RTB_String.SelectionColor = Color.Green;
            RTB_String.SelectionFont  = new System.Drawing.Font("Microsoft Sans Serif", 14.5F, System.Drawing.FontStyle.Underline);

            BUS_Typing.StopFocus(this);
            Control ctn = FindControlByTag(pn_Keys, iAscii); //.Controls[name];

            if (ctn != null)
            {
                HighLight((Button)ctn);
                HighLightShift(RTB_String.Text[PositionKey]);
            }
            if (PositionKey < RTB_String.Text.Length)
            {
                SetFingerVisible(RTB_String.Text[PositionKey].ToString().ToLower());
            }
            this.KeyPreview = true;

            if (finished == true)
            {
                Frm_Rating rating;

                if (canRemake == true)
                {
                    rating = new Frm_Rating(objectmodel.Star, objectmodel, timeLeft, PositionKey);
                }
                else
                {
                    rating = new Frm_Rating(objectmodel.Star);
                }

                this.Show();
                rating.ShowDialog(this);
                this.Close();
            }
        }
Example #2
0
        private void Frm_LuyenTap_Load(object sender, EventArgs e)
        {
            aTimer.Tick    += ATimer_Tick;
            aTimer.Interval = 3000;

            BUS_Typing.StopFocus(this);
            this.KeyPreview = true;
            ShowKeys(0);
        }