コード例 #1
0
 private void btnExit_Click(object sender, EventArgs e)
 {
     if (thsend != null)
     {
         thsend.Abort();
         thsend = null;
     }
     tc = null;
     this.Close();
 }
コード例 #2
0
 private void btnStop_Click(object sender, EventArgs e)
 {
     btnStop.Enabled = false;
     if (thsend != null)
     {
         thsend.Abort();
         thsend = null;
     }
     tc = null;
     btnSend.Enabled = true;
 }
コード例 #3
0
        private void btnSend_Click(object sender, EventArgs e)
        {
            listBox1.Items.Clear();
            int startNum, stopNum, minNum;

            startNum = Num.IntParse(comboBox1.Text);
            stopNum  = Num.IntParse(comboBox2.Text);
            if (stopNum < startNum)
            {
                minNum = startNum; startNum = stopNum; stopNum = minNum;
            }
            btnSend.Enabled = false;
            tc     = new tempClass(startNum, stopNum);
            tc.st  = new sendText(SendTextToMcgs);
            thsend = new Thread(new ThreadStart(tc.SendStrToMcgs));
            thsend.IsBackground = true;
            thsend.Start();
            btnStop.Enabled = true;
        }