示例#1
0
文件: Form1.cs 项目: SkiTiSu/TSLib
        private void button4_Click(object sender, EventArgs e)
        {
            TSSerialPort p = (TSSerialPort)comboBox.SelectedItem;

            p.Open();
            p.SerialArrived += p_SerialArrived;
        }
示例#2
0
文件: Form1.cs 项目: SkiTiSu/TSLib
        private void Form1_Load(object sender, EventArgs e)
        {
            List <TSSerialPort> ss = TSSerialPort.GetPorts();

            foreach (TSSerialPort s in ss)
            {
                comboBox.Items.Add(s);
            }
            if (comboBox.Items.Count != 0)
            {
                comboBox.SelectedIndex = 0;
            }

            CheckForIllegalCrossThreadCalls = false;
        }