private void talk_btn_Click(object sender, EventArgs e) { if (comm != null) { comm.Close(); } set_conn_text(); comm = new SerialComm((string)com_combo_box.SelectedItem, 115200); set_conn_text(); }
private void init_serial_ports() { // Load serial port data into com_combo_box com_combo_box.BeginUpdate(); com_combo_box.Items.Clear(); foreach (string s in SerialComm.GetSerialPorts()) { com_combo_box.Items.Add(s); } com_combo_box.EndUpdate(); if (com_combo_box.Items.Count > 0) { com_combo_box.SelectedIndex = 0; } }