private void FormVerification_FormClosing(object sender, FormClosingEventArgs e) { /* 停止传感器 */ m_flowSensor.Stop(); /* 取消监听流量传感器数据收取事件 */ m_flowSensor.PresureRecved -= OnPresureRecved; }
private void Form1_FormClosing(object sender, FormClosingEventArgs e) { if ("停止" == toolStripButtonStart.Text) { /* 停止流速传感器 */ m_flowSensor.Stop(); } if ("断开" == toolStripButtonConnect.Text) { /* 关闭流速传感器 */ m_flowSensor.Close(); } }