Beispiel #1
0
        private void addNewToolStripMenuItem_Click(object sender, EventArgs e)
        {
            complaintregister frm = new complaintregister();

            frm.MdiParent = this;
            frm.Show();
        }
        private void DataGridView3_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (p1 == 0)
            {
                complaintregister r = null;

                foreach (Form f in Application.OpenForms)
                {
                    if (f is complaintregister)
                    {
                        r = (complaintregister)f;
                        break;
                    }
                }

                if (r == null)
                {
                    return;
                }

                DataGridViewRow row = DataGridView3.Rows[e.RowIndex];


                r.label7.Text    = row.Cells[0].Value.ToString();
                r.textBox1.Text  = row.Cells[1].Value.ToString();
                r.dpdob.Text     = row.Cells[2].Value.ToString();
                r.textBox2.Text  = row.Cells[3].Value.ToString();
                r.textBox3.Text  = row.Cells[4].Value.ToString();
                r.textBox4.Text  = row.Cells[5].Value.ToString();
                r.textBox5.Text  = row.Cells[6].Value.ToString();
                r.comboBox1.Text = row.Cells[7].Value.ToString();
                r.textBox6.Text  = row.Cells[8].Value.ToString();
                r.textBox7.Text  = row.Cells[9].Value.ToString();
                r.textBox8.Text  = row.Cells[10].Value.ToString();
                r.textBox9.Text  = row.Cells[11].Value.ToString();
                r.comboBox2.Text = row.Cells[12].Value.ToString();
                r.textBox10.Text = row.Cells[13].Value.ToString();
                r.textBox11.Text = row.Cells[14].Value.ToString();

                r.groupBox1.Enabled = true;
                r.groupBox2.Enabled = true;
                r.groupBox3.Enabled = true;
                r.Button5.Enabled   = true;
                r.Button6.Enabled   = true;
                r.Button2.Enabled   = false;

                this.Dispose();
            }
        }