コード例 #1
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            string subjectCode = dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells[0].Value.ToString();

            FrmAddSubject frmAddSub = new FrmAddSubject(subjectCode);

            frmAddSub.ShowDialog(this);
        }
コード例 #2
0
        private void btnNew_Click(object sender, EventArgs e)
        {
            DialogResult dr2;

            FrmAddSubject frmAddSub = new FrmAddSubject();
            DialogResult  dr        = frmAddSub.ShowDialog(this);

            while (dr == DialogResult.Yes)
            {
                ViewSubject();
                dr2 = frmAddSub.ShowDialog(this);

                if (dr2 == DialogResult.Cancel)
                {
                    break;
                }
            }
        }