コード例 #1
0
        private void uploadToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            try
            {
                if (Program.CurrentImage == null)
                {
                    MessageBox.Show("Please open image or render the text first!");
                    return;
                }

                //Initialize the comport chosing diaglog
                COMPortForm comPortDialog = new COMPortForm();
                comPortDialog.SetComPorts(System.IO.Ports.SerialPort.GetPortNames());
                comPortDialog.StartPosition = FormStartPosition.CenterParent;

                // Show comPortDialog as a modal dialog and determine if DialogResult = OK.
                comPortDialog.ShowDialog(this);
            }
            catch (Exception exeption)
            {
                MessageBox.Show(exeption.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #2
0
        private void uploadToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            try
            {
                if (Program.CurrentImage == null)
                {
                    MessageBox.Show("Please open image or render the text first!");
                    return;
                }

                //Initialize the comport chosing diaglog
                COMPortForm comPortDialog = new COMPortForm();
                comPortDialog.SetComPorts(System.IO.Ports.SerialPort.GetPortNames());
                comPortDialog.StartPosition = FormStartPosition.CenterParent;

                // Show comPortDialog as a modal dialog and determine if DialogResult = OK.
                comPortDialog.ShowDialog(this);
            }
            catch (Exception exeption)
            {
                MessageBox.Show(exeption.Message, "Error",MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }