Beispiel #1
0
        private void button8_Click(object sender, EventArgs e)
        {
            try
            {
                dispenser.SetConfiguration(tbDispPort.Text, Int32.Parse(tbDispBaudRate.Text), (Parity)Enum.Parse(typeof(Parity), tbDispParity.Text),
                                           Int32.Parse(tbDispBits.Text), (StopBits)Enum.Parse(typeof(StopBits), tbDispStopBits.Text));
                dispenser.Open();

                button6.Enabled  = true;
                button5.Enabled  = true;
                button9.Enabled  = true;
                button8.Enabled  = false;
                button21.Enabled = true;
            }
            catch
            {
                button6.Enabled  = false;
                button5.Enabled  = false;
                button9.Enabled  = false;
                button21.Enabled = false;
            }
        }