Exemplo n.º 1
0
        private void SerialSettingMenuItem_Click(object sender, EventArgs e)
        {
            /*
            if (sp.IsOpen) { sp.Close(); ToolStrip_Cond.Text = "串口已关闭"; SerialSettingMenuItem.Text = "串口设置"; return; }
            sp.Open();
            SerialSettingMenuItem.Text = "关闭串口";
            ToolStrip_Cond.Text = "串口已打开";
            */

            if (sp.IsOpen) { sp.Close(); ToolStrip_Cond.Text = "串口已关闭"; SerialSettingMenuItem.Text = "串口设置"; return; }
            SerialSetting ss = new SerialSetting(sp);
            ss.ShowDialog();
            SerialSettingMenuItem.Text = "关闭串口";
            ToolStrip_Cond.Text = "串口已打开";
        }
Exemplo n.º 2
0
        private void SerialSettingMenuItem_Click(object sender, EventArgs e)
        {
            /*
             * if (sp.IsOpen) { sp.Close(); ToolStrip_Cond.Text = "串口已关闭"; SerialSettingMenuItem.Text = "串口设置"; return; }
             * sp.Open();
             * SerialSettingMenuItem.Text = "关闭串口";
             * ToolStrip_Cond.Text = "串口已打开";
             */

            if (sp.IsOpen)
            {
                sp.Close(); ToolStrip_Cond.Text = "串口已关闭"; SerialSettingMenuItem.Text = "串口设置"; return;
            }
            SerialSetting ss = new SerialSetting(sp);

            ss.ShowDialog();
            SerialSettingMenuItem.Text = "关闭串口";
            ToolStrip_Cond.Text        = "串口已打开";
        }