Ejemplo n.º 1
0
        private void btEditar_Click(object sender, EventArgs e)
        {
            if (dgvCategoria.RowCount > 0)
            {
                if (editarCategoria == null)
                {
                    editarCategoria = new formCategoriaEditar((int)dgvCategoria.CurrentRow.Cells[0].Value, dgvCategoria.CurrentRow.Cells[1].Value.ToString());

                    editarCategoria.MdiParent = ActiveForm;
                    editarCategoria.Show();
                    editarCategoria.FormClosed += new FormClosedEventHandler(editarCategoriaNull);
                }
            }
            else
            {
                MessageBox.Show("Erro ao editar a categoria, clique na categoria e tenta novamente", "ERRO: Editar categoria", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 2
0
 private void editarCategoriaNull(object sender, EventArgs e)
 {
     editarCategoria = null;
 }