private void alterarClienteBtn_Click_1(object sender, EventArgs e) { if (CodigoCliente != 0) { if (alterarCliente == null) { alterarCliente = new AlterarCliente(CodigoCliente); alterarCliente.Disposed += new EventHandler(alterarCliente_Disposed_1); alterarCliente.Show(); } DALCliente dALCliente = new DALCliente(); Cliente cliente = dALCliente.carregaCliente(CodigoCliente); } else { MessageBox.Show("Tabela vazia ou cliente nao selecionado!", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
void alterarCliente_Disposed_1(object sender, EventArgs e) { alterarCliente = null; }