private void btnConfigureComPort_Click(object sender, EventArgs e)
        {
            if (comPortConfigForm != null && comPortConfigForm.Visible)
            {
                return;
            }

            CloseComPort();
            availableComPortNames = FindAvailableComPorts();

            try
            {
                comPortConfigForm.SetComboBoxes(this.availableComPortNames, this.comPortName, this.baudRate, this.parity, this.dataBits, this.stopBits, this.handshake, this.rtsEnable, this.dtrEnable);
                comPortConfigForm.ShowDialog();
            }
            catch (Exception)
            {
                comPortConfigForm = new ComPortConfigForm(this);
                comPortConfigForm.SetComboBoxes(this.availableComPortNames, this.comPortName, this.baudRate, this.parity, this.dataBits, this.stopBits, this.handshake, this.rtsEnable, this.dtrEnable);
                comPortConfigForm.ShowDialog();
            }
        }
        private void btnConfigureComPort_Click(object sender, EventArgs e)
        {
            if (comPortConfigForm != null && comPortConfigForm.Visible)
                    return;

               CloseComPort();
               availableComPortNames = FindAvailableComPorts();

               try
               {
                    comPortConfigForm.SetComboBoxes(this.availableComPortNames, this.comPortName, this.baudRate, this.parity, this.dataBits, this.stopBits, this.handshake, this.rtsEnable, this.dtrEnable);
                    comPortConfigForm.ShowDialog();
               }
               catch (Exception)
               {
                    comPortConfigForm = new ComPortConfigForm(this);
                    comPortConfigForm.SetComboBoxes(this.availableComPortNames, this.comPortName, this.baudRate, this.parity, this.dataBits, this.stopBits, this.handshake, this.rtsEnable, this.dtrEnable);
                    comPortConfigForm.ShowDialog();
               }
        }