private void button5_Click(object sender, EventArgs e) { if (COM3.IsOpen) { COM3.Close(); progressBar2.Value = 0; } }
private void button4_Click(object sender, EventArgs e) { try { if (COM3.IsOpen) { COM3.Write("3"); COM3.Close(); richTextBox1.Text = "закрыт"; m_state = WorkState.Idle; } ; } catch { } }
private void Form1_FormClosed(object sender, FormClosedEventArgs e) { COM3.Close(); }