Beispiel #1
0
 private void simpleButtonCommunication_Click(object sender, EventArgs e)
 {
     if (simpleButtonCommunication.Text == "连接")
     {
         simpleButtonCommunication.Text    = "断开";
         comboBoxEditCommunication.Enabled = false;
         comboBoxEdit5.Enabled             = false;
         comboBoxEdit6.Enabled             = false;
         PLAASerialPort.Open(comboBoxEdit5.Text, int.Parse(comboBoxEdit6.Text));
     }
     else
     {
         simpleButtonCommunication.Text    = "连接";
         comboBoxEditCommunication.Enabled = true;
         comboBoxEdit5.Enabled             = true;
         comboBoxEdit6.Enabled             = true;
         PLAASerialPort.Close();
     }
 }
Beispiel #2
0
 private void MainXtraForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     PLAASerialPort.Close();
 }