private void timer1_Tick(object sender, EventArgs e)
        {
            if (thietlapHeSo.checkstop)
            {
                timer1.Stop();
                if (thietlapHeSo.findmax == false)
                {
                    foundedcolor.Text = middle.getFoundedColorValue().ToString();
                }
                else
                {
                    foundedcolor.Text = middle.getColorNumberMaxValue().ToString();
                }
                processSpeed.Text = "0";
                if (giay < 1)
                {
                    processtime.Text = "0h 0m 0s";
                }
                estimate.Text = "0h 0m 0s";

                pbMyProgressBar.Value   = 100;
                continueGrid.Visibility = System.Windows.Visibility.Visible;
                MessageBox.Show("Tìm kiếm kết thúc");
            }
            else
            {
                if ((giay + 1) == 60)
                {
                    ++phut;
                    giay = -1;
                }
                if ((phut + 1) == 60)
                {
                    ++gio;
                    phut = -1;
                }
                processtime.Text = gio.ToString() + "h " + phut.ToString() + "m " + (++giay).ToString() + "s";


                speed1  = middle.getFoundedColorValue() - speed2;
                speed2 += speed1;


                sp          = speed1;
                totalcolor -= sp;
                if (sp == 0)
                {
                    sp = 1;
                }

                if (giay == 1 && phut == 0 && gio == 0)
                {
                    es_giay       = totalcolor / sp;
                    es_giay_old   = es_giay;
                    es_gio        = es_giay / 3600;
                    es_giay      %= 3600;
                    es_phut       = es_giay / 60;
                    es_giay      %= 60;
                    estimate.Text = es_gio.ToString() + "h " + es_phut.ToString() + "m " + es_giay.ToString() + "s";
                }
                else
                {
                    if (sp == 0)
                    {
                        sp = 1;
                    }
                    if (es_giay_old > (totalcolor / sp))
                    {
                        es_giay     = totalcolor / sp;
                        es_giay_old = es_giay;
                        es_gio      = es_giay / 3600;
                        es_giay    %= 3600;
                        es_phut     = es_giay / 60;
                        es_giay    %= 60;
                        if (thietlapHeSo.findmax == false)
                        {
                            estimate.Text = es_gio.ToString() + "h " + es_phut.ToString() + "m " + es_giay.ToString() + "s";
                        }
                        else
                        {
                            estimate.Text = "Đang cập nhật ...";
                        }
                    }
                }

                if (thietlapHeSo.findmax == false)
                {
                    processSpeed.Text     = speed1.ToString() + " nhóm màu/s";
                    foundedcolor.Text     = middle.getFoundedColorValue().ToString();
                    foundcolor            = (decimal)middle.getFoundedColorValue();
                    convertBigInt        += (Decimal.Divide(foundcolor - foundcolor_old, number1) * 100);
                    foundcolor_old        = foundcolor;
                    pbMyProgressBar.Value = (double)convertBigInt;
                }
                else
                {
                    processSpeed.Text = "Đang cập nhật ...";
                    foundedcolor.Text = "Đang cập nhật ...";
                }
            }
        }