コード例 #1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            frmAddProduct f = new frmAddProduct(this);

            f.StartPosition = FormStartPosition.CenterScreen;
            f.MdiParent     = this.MdiParent;
            f.Show();
        }
コード例 #2
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            try
            {
                object  id          = dataGridView1.CurrentRow.Cells["PRODUCT_id"].Value;
                DataRow selectedRow = dtProducts.Rows.Find(id);

                frmAddProduct f = new frmAddProduct(this, selectedRow);
                f.StartPosition = FormStartPosition.CenterScreen;
                f.MdiParent     = this.MdiParent;
                f.Show();
            }
            catch (Exception ex) { }
        }