Ejemplo n.º 1
0
        private void portSetupToolStripMenuItem_Click(object sender, EventArgs e)
        {
            PortSet dlg = new PortSet();

            dlg.n1 = n1;
            dlg.n2 = n2;
            dlg.n3 = n3;
            dlg.n4 = n4;
            dlg.n5 = n5;
            dlg.ShowDialog();
            ConnectionStr = dlg.ConnectionStr;
            n1            = dlg.n1;
            n2            = dlg.n2;
            n3            = dlg.n3;
            n4            = dlg.n4;
            n5            = dlg.n5;
            s1            = dlg.cbPortno.Text;
            s2            = dlg.cbBaudrate.Text;
            s3            = dlg.cbParity.Text;
            s4            = dlg.cbDatabits.Text;
            s5            = dlg.cbStopbit.Text;
            toolStripStatusLabel1.Text = ConnectionStr;
            textBox1.Text = ConnectionStr;

            portOpenToolStripMenuItem_Click(sender, e);
        }
Ejemplo n.º 2
0
        private void testToolStripMenuItem_Click(object sender, EventArgs e)
        {
            PortSet dlg = new PortSet();

            dlg.n1 = n1;
            dlg.n2 = n2;
            dlg.n3 = n3;
            dlg.n4 = n4;
            dlg.n5 = n5;
            dlg.ShowDialog();
            ConnectionStr = dlg.ConnectionStr;
            n1            = dlg.n1;
            n2            = dlg.n2;
            n3            = dlg.n3;
            n4            = dlg.n4;
            n5            = dlg.n5;
            toolStripStatusLabel1.Text      = ConnectionStr;
            toolStripStatusLabel1.BackColor = Color.Green;
        }