示例#1
0
        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            speech_num = comboBox1.SelectedIndex;

            Time_Records.AppendText(SpeechTime[speech_num].name.ToString());
            Time_Records.AppendText("\r\n");

            button_A.Select();
        }
示例#2
0
        private void button_B_Click(object sender, EventArgs e)
        {
            TimeSpan ts = sw.Elapsed;

            if (comboBox1.SelectedIndex == -1)
            {
                MessageBox.Show("スピーチを選択してください。");
            }
            else
            {
                if (!SpeechTime[speech_num].name.Equals("コンテスト (5-7分)"))
                {
                    currentTime = String.Format("{0:00}:{1:00}", ts.Minutes, ts.Seconds);
                    if (currentTime != "00:00")
                    {
                        Time_Records.AppendText(currentTime);
                        if (ts > SpeechTime[speech_num].time_End)
                        {
                            Time_Records.AppendText("(++)");
                        }
                        else if (ts < SpeechTime[speech_num].time_Green)
                        {
                            Time_Records.AppendText("(--)");
                        }
                        Time_Records.AppendText("\r\n");
                    }
                }

                sw.Stop();
                sw.Reset();
                dt.Stop();

                this.Color_panel.BackColor = System.Drawing.Color.FromArgb(0x00, 0x00, 0x00);
                if (com_connected)
                {
                    serialPort1.Write("B");
                }
                TextBox_ElapsedTime.Text = "00:00";
                button_A.Text            = "開始";
            }
        }