Exemple #1
0
        private void cadastroToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            frmCadastroCarro cadCarro = new frmCadastroCarro(null);

            cadCarro.MdiParent = this;
            cadCarro.Show();
        }
        private void dgvCarros_SelectionChanged(object sender, EventArgs e)
        {
            if (((DataGridView)sender).SelectedRows.Count > 0)
            {
                int idSelecionado = Convert.ToInt32(((DataGridView)sender).SelectedRows[0].Cells[0].Value);

                frmCadastroCarro cadCarro = new frmCadastroCarro(idSelecionado);
                cadCarro.ShowDialog();

                CarregarGridViewCarros();
            }
        }