private void btnSend_Click(object sender, EventArgs e) { btnSend.Enabled = false; tc = new tempClass(Convert.ToInt16(cbbStart.Text), Convert.ToInt16(cbbEnd.Text)); tc.st = new SendText(SendModeSet); SendThread = new Thread(new ThreadStart(tc.send)); SendThread.IsBackground = true; SendThread.Start(); btnStop.Enabled = true; }
private void btnClose_Click(object sender, EventArgs e) { if (mUdp != null) { mUdp.fUdpClose(); mUdp = null; } if (SendThread != null) { SendThread.Abort(); SendThread = null; } tc = null; this.Close(); this.Dispose(); }
private void btnStop_Click(object sender, EventArgs e) { btnStop.Enabled = false; if (mUdp != null) { mUdp.fUdpClose(); mUdp = null; } if (SendThread != null) { SendThread.Abort(); SendThread = null; } tc = null; btnSend.Enabled = true; }