示例#1
0
 private void button8_Click(object sender, System.EventArgs e)//ตั้งค่า ปิดดักจับคียแพท คิดเลข
 {
     DetectCalPAD.Stop();
     button8.Hide();
     button9.Show();
     panel4.BackColor = Color.Red;
     ConfigFile.SettingFileWrite("Cal", "0");
 }
示例#2
0
        private void Main_Load(object sender, System.EventArgs e) //เรียกใช้ครั้งแรกทำอะไรดีน้า
        {
            TimeOnline.Interval = 500;
            TimeOnline.Start();
            //-----------------ตั้งค่า
            string[] CheckConfig = new string[4]; //เพิ่มตั้งค่าเพิ่มขนาดด้วย

            CheckConfig[0] = ConfigFile.SettingFileRead("hangoutshow");
            CheckConfig[1] = ConfigFile.SettingFileRead("tauto");
            CheckConfig[2] = ConfigFile.SettingFileRead("botTalk");
            CheckConfig[3] = ConfigFile.SettingFileRead("Cal");

            if (CheckConfig[0] == "0")// แสดงการทำงาน hangout
            {
                listEvents.Hide();
                rtfDebug.Hide();
                on.Show();
                off.Hide();
                panel1.BackColor = Color.Red;
            }
            else
            {
                listEvents.Show();
                rtfDebug.Show();
                on.Hide();
                off.Show();
                panel1.BackColor = Color.GreenYellow;
            }
            //------------------------------------------
            if (CheckConfig[1] == "0")//การแปลภาษาอัติโนมัติ
            {
                checkBot         = true;
                panel2.BackColor = Color.Red;
                button5.Hide();
                button6.Show();
                TAuto.Stop();
            }
            else
            {
                button6.Hide();
                button5.Show();
                panel2.BackColor = Color.GreenYellow;
                checkBot         = false;
                TAuto.Interval   = 2000;
                TAuto.Start();
            }
            //---------------------------------------
            if (CheckConfig[2] == "0")//อนุญาติบอทคุยแฮงเอ้า
            {
                button4.Hide();
                button7.Show();
                panel3.BackColor = Color.Red;
            }
            else
            {
                button7.Hide();
                button4.Show();
                panel3.BackColor = Color.GreenYellow;
            }
            //----------------------------+
            if (CheckConfig[3] == "0")//เครื่องคิดเลข
            {
                DetectCalPAD.Stop();
                button8.Hide();
                button9.Show();
                panel4.BackColor = Color.Red;
            }
            else
            {
                DetectCalPAD.Interval = 50;
                DetectCalPAD.Start();
                button9.Hide();
                button8.Show();
                panel4.BackColor = Color.GreenYellow;
            }
            //----------------------------------


            //------------ETC LOADING Set----------------
            SwitchFace.Interval = 1200;
            SwitchFace.Start();
            SwtichFace2.Interval = 5000;
            SwtichFace2.Start();
            //--------message bot
            textBox2.Hide();
            pictureBox3.Hide();
            textBox2.Enabled = false;
            //--------------------------------

            //-------talk bot
            groupBox2.Hide();
            //-------------------------------
        }