Exemple #1
0
        private void edit_Click(object sender, EventArgs e)
        {
            SettingInfo sForm = new SettingInfo();

            if (this.portData.SelectedRows.Count > 0)
            {
                if (this.portData.SelectedRows.Count == 1)
                {
                    var row = this.portData.SelectedRows[0].Cells;
                    // info. = ;
                    sForm.Id        = Int32.Parse(row[0].Value.ToString());
                    sForm.Port      = row[1].Value.ToString();
                    sForm.Baud_rate = row[2].Value.ToString();
                    sForm.Tag       = row[3].Value.ToString();
                    var childForm = new PortManager(sForm);
                    var result    = childForm.ShowDialog();
                    if (result == DialogResult.OK)
                    {
                        MultiSettingForm_Load(sender, e);
                    }
                }
                else
                {
                    MessageBox.Show("请选择一条数据进行编辑!");
                    return;
                }
            }
        }
Exemple #2
0
        private void add_Click(object sender, EventArgs e)
        {
            var childForm = new PortManager();
            var result    = childForm.ShowDialog();

            if (result == DialogResult.OK)
            {
                MultiSettingForm_Load(sender, e);
            }
        }