private void Control_3_Click(object sender, EventArgs e) { if (COM3.IsOpen) { string output; output = textBox16.Text; COM3.Write(output); textBox16.Text = ""; COM3.DiscardOutBuffer(); order_record_3(output); } }
private void button4_Click(object sender, EventArgs e) { try { if (COM3.IsOpen) { COM3.Write("3"); COM3.Close(); richTextBox1.Text = "закрыт"; m_state = WorkState.Idle; } ; } catch { } }